Upload a large file

POST/v1/files/uploads

Start an upload of any size up to the limits: you get a file id and a signed URL to PUT the bytes to, straight to storage.

1. Call this with the file's type and size. 2. PUT the file to upload.url with the Content-Type header given (within 15 minutes). 3. Call POST /v1/files/{id}/complete. The file is usable after step 3.

Needs the files scope.

Body

FieldTypeDescription
content_typerequiredstringThe file's type.One of "image/png", "image/jpeg", "image/webp", "video/mp4", "video/quicktime", "video/webm".
bytesrequiredintegerThe file's size in bytes.
namestringThe file name, for your records.

Example

curl -X POST https://www.luce.space/api/v1/files/uploads \
  -H "Authorization: Bearer $LUCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "content_type": "video/mp4",
  "bytes": 48213744,
  "name": "walkthrough.mp4"
}'

Response

HTTP 201.

{
  "id": "file_Jl2EkOMeVu6EXhts",
  "object": "file",
  "status": "uploading",
  "kind": "video",
  "content_type": "video/mp4",
  "bytes": 48213744,
  "width": null,
  "height": null,
  "name": "walkthrough.mp4",
  "url": "https://media.luce.space/teams/…/api-files/file_Jl2EkOMeVu6EXhts.mp4",
  "created_at": "2026-11-24T10:14:55.010Z",
  "expires_at": "2026-12-24T10:14:55.010Z",
  "upload": {
    "url": "https://….r2.cloudflarestorage.com/…?X-Amz-Signature=…",
    "method": "PUT",
    "headers": {
      "Content-Type": "video/mp4"
    },
    "expires_at": "2026-11-24T10:29:55.010Z"
  }
}

Errors

codeWhen
invalid_bodyThe body isn't valid JSON or misses a required field.
invalid_paramA field has a wrong type or an out-of-range value; param names it.
Upload a large file — Luce API reference