Finalize an upload (start transcode)
const url = 'https://api.devstreamcore.com/v1/uploads/up_a1b2c3d4e5f6a1b2c3d4/finalize';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"mime_type":"example","file_size_bytes":1,"duration_secs":1,"source_height":1,"source_width":1,"upload_id":"example","parts":[{"partNumber":1,"etag":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.devstreamcore.com/v1/uploads/up_a1b2c3d4e5f6a1b2c3d4/finalize \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "mime_type": "example", "file_size_bytes": 1, "duration_secs": 1, "source_height": 1, "source_width": 1, "upload_id": "example", "parts": [ { "partNumber": 1, "etag": "example" } ] }'Idempotent. For multipart, include upload_id and parts[].
Authorizations
Seção intitulada “Authorizations ”Parameters
Seção intitulada “ Parameters ”Path Parameters
Seção intitulada “Path Parameters ”Example
up_a1b2c3d4e5f6a1b2c3d4Request Body
Seção intitulada “Request Body ”object
object
Example generated
{ "mime_type": "example", "file_size_bytes": 1, "duration_secs": 1, "source_height": 1, "source_width": 1, "upload_id": "example", "parts": [ { "partNumber": 1, "etag": "example" } ]}Responses
Seção intitulada “ Responses ”The video (transcode queued)
A video asset. The shape is stable — fields are only ever added.
object
0–100, aggregated across encode + package jobs
Seconds
Public URL of the original upload; null until landed in R2
Native width of the original upload (px); null when unknown
Native height of the original upload (px); null when unknown
object
object
Encode target bitrate in kb/s; null on legacy rows
Per-resolution HLS variant playlist URL; null when ungated
object
object
object
Example
{ "id": "vid_a1b2c3d4e5f6a1b2c3d4", "status": "preparing", "playback_ids": [ { "id": "play_a1b2c3d4e5f6a1b2c3d4", "policy": "public" } ], "policy": "public", "ingest": { "kind": "direct_upload" }}Invalid request
Error envelope — a single error per response.
object
object
Example
{ "error": { "type": "invalid_request_error" }}Missing or invalid API key
Error envelope — a single error per response.
object
object
Example
{ "error": { "type": "invalid_request_error" }}Quota exceeded (encode minutes / duration / views)
Error envelope — a single error per response.
object
object
Example
{ "error": { "type": "invalid_request_error" }}Resource not found
Error envelope — a single error per response.
object
object
Example
{ "error": { "type": "invalid_request_error" }}