Authentication
All upload endpoints require authentication via tRPC context. The user must be logged in.Simple Upload
requestUploadUrl
Request a presigned URL for direct file upload.Name of the file being uploaded
MIME type of the file (e.g.,
image/jpeg, video/mp4)File size in bytes
confirmUpload
Mark a file as successfully uploaded.File record ID from
requestUploadUrlMultipart Upload
For files larger than 10MB, use multipart upload for resumability.initiateMultipart
Start a new multipart upload.Name of the file
MIME type of the file
Total file size in bytes
Number of parts the file will be split into
getPartUrl
Get presigned URL for uploading a specific part.File record ID
Part number (1-indexed)
completePart
Record that a part has been uploaded successfully.File record ID
Part number that was uploaded
ETag returned from S3 after uploading the part
completeMultipart
Finalize the multipart upload after all parts are uploaded.File record ID
abortMultipart
Cancel a multipart upload and clean up parts.File record ID
Error Codes
| Code | Description |
|---|---|
UNAUTHORIZED | User not authenticated |
BAD_REQUEST | Invalid file type or size |
QUOTA_EXCEEDED | User storage quota exceeded |
NOT_FOUND | File record not found |
INTERNAL_SERVER_ERROR | S3 or database error |
Allowed MIME Types
ALLOWED_MIME_TYPES in apps/api/src/routers/upload.ts.
Size Limits
| Limit | Value |
|---|---|
| Simple upload max | 10 MB |
| Multipart part size | 5 MB |
| Maximum file size | 5 GB |
| Default user quota | 500 MB |
Test Checklist
requestUploadUrlreturns a presigned URL- Upload succeeds and
confirmUploadmarks the file as uploaded - Multipart uploads complete successfully
Troubleshooting
If you seeBAD_REQUEST or QUOTA_EXCEEDED, confirm allowed MIME types and
storage quota configuration.
Remove / Disable
To disable uploads while you configure S3, set:apps/mobile/features/feature-registry.tsx → featureFlags.fileUploads = false
For production removal guidance, see Removing Features.