Finalize a direct file upload
Confirms that a previously presigned upload completed successfully, validates the stored object metadata and size, and then creates the file DB record.
Confirms that a previously presigned upload completed successfully, validates the stored object metadata and size, and then creates the file DB record.
Production session cookie set for the guidelab.co domain by Better Auth
In: cookie
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/files/finalize" \ -H "Content-Type: application/json" \ -d '{ "finalizeToken": "string" }'{ "id": "string", "partnershipId": "string", "uploadedByOrganizationId": "string", "name": "string", "type": "string", "mimeType": "string", "size": 0, "url": "string", "thumbnailUrl": "string", "orderId": "string", "patientId": "string", "orderItemId": "string", "fileRequirementId": "string", "createdAt": "string"}Download a file GET
Streams the file content directly from R2 through the Worker (R2 egress is free; this avoids presigned-URL redirects and CORS surprises). Pass `?thumbnail=true` for the thumbnail variant.
List files GET
Returns a paginated list of files for the current organization. Labs see all files; clinics see only their own. Supports filtering by patient, clinic, file type, and unassigned status.