API reference · Files
GET/api/files/{fileId}/download

Download file by ID

Downloads a stored external file as an attachment by external_files.file_id. The route is skipped by API-key middleware and relies on session/tenant resolution through createTenantKnex and StorageService. Storage lookup is tenant-scoped to external_files.tenant and is_deleted=false, but the handler performs no explicit per-document authorization; any user resolved into the tenant can download a file by fileId. The response body is binary and Content-Type is taken from stored file metadata.

Path parameters

fileIdstring <uuid>Required
File UUID from external_files.file_id to download. The handler does not validate UUID syntax before querying storage metadata.

Response codes

200
Binary file download with attachment Content-Disposition. Content-Type varies by stored MIME type.
404
Tenant could not be resolved by createTenantKnex.
500
File metadata/storage lookup failed or another download error occurred.