Video APIv1 Home OpenAPI spec

Docs › Uploading videos

Uploading videos

  1. Create the video with its file name and exact size: POST /videos. You get a videoId, a partSize (64 MiB) and a partCount.
  2. Get part URLs: POST /videos/{videoId}/parts with up to 100 partNumbers per call. Each URL is valid for 15 minutes, so request them shortly before use.
  3. Upload each part with PUT <url>. Part n is the byte range starting at (n − 1) × partSize, exactly sizeBytes long. Send no Authorization header. Parts can upload in parallel (4–8 at a time works well) and in any order.
  4. Complete: POST /videos/{videoId}/complete, optionally with processing options. Processing starts.
POST /videos
{ "fileName": "lesson.mp4", "sizeBytes": 734003200, "maxHeight": 1080 }

201 Created
{ "videoId": "3f1c0a9e5b7d4c2a8e6f1b0d9c7a5e3f", "partSize": 67108864, "partCount": 11,
  "status": "UPLOADING", "statusPath": "/videos/3f1c0a9e5b7d4c2a8e6f1b0d9c7a5e3f" }

POST /videos/3f1c…/parts
{ "partNumbers": [1, 2, 3] }

200 OK
{ "parts": [ { "partNumber": 1, "sizeBytes": 67108864, "url": "https://…" }, … ], "expiresInSeconds": 900 }
  • Retries: if a part fails or its URL expires, request a new URL for that part number and upload it again. complete is safe to call more than once: it never starts a second job.
  • Abandoned uploads (never completed) are deleted automatically after 2 days. To discard one sooner, call POST /videos/{videoId}/abort.
  • Incomplete uploads: complete answers 409 UPLOAD_INCOMPLETE if a part is missing or the wrong size.