Skip to Content
API reference

Uploads API

Resumable browser uploads.

Your backend creates the upload; the browser sends S3 multipart parts straight to storage with the upload token, then completes it.

Create an upload

POST /v1/uploads

Call from your backend, then hand the body to the browser uploader. The asset exists at once in waiting_upload, with its playback IDs, so you can store them before the file arrives. generate asks for subtitles and chapters once the video is ready; renditions limits the ladder.

Authentication: An API key with uploads:write.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringnoA retry with the same key and request returns the first response; a different request is 422 idempotency_key_reused.

Request body

FieldTypeRequiredDescription
sizeintegeryesThe file size in bytes.
playback_policy"signed", "public"noThe policy of the playback ID made with the asset. Default signed.
passthroughstringnoYour own reference; it comes back on the asset and its webhooks.
titlestringnoOne line, up to 200 characters.
generateGeneratenoAsk for subtitles and chapters once the video is ready; chapters imply subtitles.
renditionsRenditionsnoThe ladder rungs to encode, e.g. ["1080p", "480p"]. Rungs above the source are skipped; if none chosen fits, the largest rung that fits is encoded. Leave it out for every rung up to the source. Shown largest first.
{
  "size": 734003200,
  "playback_policy": "signed",
  "passthrough": "lesson_42",
  "title": "Lesson 42: Sorting",
  "generate": {
    "subtitles": true,
    "chapters": true
  }
}

Response 201

Created

{
  "upload_id": "upl_01jx169zxgft4kq0ydjct7r5y4",
  "asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
  "part_size": 33554432,
  "part_count": 22,
  "upload_token": "M4XQ7R2VK6WT5ZJYBNC3D4F7GH",
  "playback_ids": [
    {
      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
      "policy": "signed",
      "playable": true,
      "status": "active"
    }
  ]
}

Errors

Sign part URLs

POST /v1/uploads/{id}/parts

Up to 100 part numbers at a time. PUT each part's bytes to its URL before expires_at, and keep the ETag storage returns for each.

Authentication: The upload's upload_token.

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body

FieldTypeRequiredDescription
part_numbersarray of integeryes
{
  "part_numbers": [
    1,
    2,
    3
  ]
}

Response 200

Signed URLs; PUT each part and keep its ETag

{
  "parts": [
    {
      "part_number": 1,
      "url": "https://storage.example.com/...&partNumber=1&..."
    }
  ],
  "expires_at": "2026-11-18T10:30:00Z"
}

Errors

List stored parts, for resuming

GET /v1/uploads/{id}/parts

The parts storage already holds, so an upload can resume after a dropped connection or a closed tab.

Authentication: The upload's upload_token.

Parameters

NameInTypeRequiredDescription
idpathstringyes

Response 200

Parts storage holds

{
  "parts": [
    {
      "part_number": 1,
      "etag": "\"9b2cf535f27731c974343645a3985328\"",
      "size": 33554432
    }
  ]
}

Errors

Complete an upload

POST /v1/uploads/{id}/complete

Send every part's number and ETag. The asset moves to processing, and encoding starts.

Authentication: The upload's upload_token.

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body

FieldTypeRequiredDescription
partsarray of objectyes
{
  "parts": [
    {
      "part_number": 1,
      "etag": "\"9b2cf535f27731c974343645a3985328\""
    }
  ]
}

Response 200

The asset, processing

{
  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
  "status": "processing",
  "version": 2,
  "passthrough": "lesson_42",
  "title": "Lesson 42: Sorting",
  "base_url": "https://media.example.com",
  "playback_ids": [
    {
      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
      "policy": "signed",
      "playable": true,
      "status": "active"
    }
  ],
  "duration_seconds": null,
  "tracks": [],
  "created_at": "2026-11-18T09:30:00Z",
  "updated_at": "2026-11-18T09:30:00Z"
}

Errors

Cancel an upload

POST /v1/uploads/{id}/cancel

Stops the upload. The asset becomes errored with error_code upload_cancelled. Takes the upload token or an API key with uploads:write.

Authentication: The upload's upload_token, or An API key with uploads:write.

Parameters

NameInTypeRequiredDescription
idpathstringyes

Response 200

The asset, errored with upload_cancelled

{
  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
  "status": "errored",
  "version": 2,
  "passthrough": "lesson_42",
  "title": "Lesson 42: Sorting",
  "base_url": "https://media.example.com",
  "playback_ids": [
    {
      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
      "policy": "signed",
      "playable": true,
      "status": "active"
    }
  ],
  "duration_seconds": null,
  "tracks": [],
  "created_at": "2026-11-18T09:30:00Z",
  "updated_at": "2026-11-18T09:30:00Z",
  "error_code": "upload_cancelled"
}

Errors

On this page