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

confirmUpload

Mark a file as successfully uploaded.
fileId
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.
filename
string
required
Name of the file
mimeType
string
required
MIME type of the file
size
number
required
Total file size in bytes
totalParts
number
required
Number of parts the file will be split into
Response:

getPartUrl

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

completePart

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

completeMultipart

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

abortMultipart

Cancel a multipart upload and clean up parts.
fileId
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.