Skip to main content

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.
string
required
Name of the file being uploaded
string
required
MIME type of the file (e.g., image/jpeg, video/mp4)
number
required
File size in bytes
Response:
Example:

confirmUpload

Mark a file as successfully uploaded.
string
required
File record ID from requestUploadUrl
Response:

Multipart Upload

For files larger than 10MB, use multipart upload for resumability.

initiateMultipart

Start a new multipart upload.
string
required
Name of the file
string
required
MIME type of the file
number
required
Total file size in bytes
number
required
Number of parts the file will be split into
Response:

getPartUrl

Get presigned URL for uploading a specific part.
string
required
File record ID
number
required
Part number (1-indexed)
Response:

completePart

Record that a part has been uploaded successfully.
string
required
File record ID
number
required
Part number that was uploaded
string
required
ETag returned from S3 after uploading the part
Response:

completeMultipart

Finalize the multipart upload after all parts are uploaded.
string
required
File record ID
Response:

abortMultipart

Cancel a multipart upload and clean up parts.
string
required
File record ID
Response:

Error Codes

Allowed MIME Types

To add more types, modify ALLOWED_MIME_TYPES in apps/api/src/routers/upload.ts.

Size Limits

Test Checklist

  • requestUploadUrl returns a presigned URL
  • Upload succeeds and confirmUpload marks the file as uploaded
  • Multipart uploads complete successfully

Troubleshooting

If you see BAD_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.tsxfeatureFlags.fileUploads = false For production removal guidance, see Removing Features.