Docs › Uploading videos
Uploading videos
- Create the video with its file name and exact size:
POST /videos. You get avideoId, apartSize(64 MiB) and apartCount. - Get part URLs:
POST /videos/{videoId}/partswith up to 100partNumbersper call. Each URL is valid for 15 minutes, so request them shortly before use. - Upload each part with
PUT <url>. Part n is the byte range starting at(n − 1) × partSize, exactlysizeByteslong. Send noAuthorizationheader. Parts can upload in parallel (4–8 at a time works well) and in any order. - 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.
completeis 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:
completeanswers409 UPLOAD_INCOMPLETEif a part is missing or the wrong size.