Create dubs
const url = 'https://api.braiv.co/v1/videos/vid_01JZ8M6A/dubs';const options = { method: 'POST', headers: { 'Idempotency-Key': 'import-launch-demo-20260901', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"languages":["es","de"],"product":"premium","sourceVoiceover":"original","reservationId":"rsv_01JZ9A","reservationLineItemIdByLanguage":{"es":"li_01","de":"li_02"}}'};
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.braiv.co/v1/videos/vid_01JZ8M6A/dubs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: import-launch-demo-20260901' \ --data '{ "languages": [ "es", "de" ], "product": "premium", "sourceVoiceover": "original", "reservationId": "rsv_01JZ9A", "reservationLineItemIdByLanguage": { "es": "li_01", "de": "li_02" } }'Queues one dub job per target language using the selected voice product and source voiceover track. Required scope: dubs:write.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Braiv library video document ID.
Example
vid_01JZ8M6AHeader Parameters
Section titled “Header Parameters ”Caller-generated key for safe POST retries. The API retains the first
JSON response for 24 hours. Reusing a key with another path or body
returns 409 IDEMPOTENCY_REPLAY.
Example
import-launch-demo-20260901Request Body required
Section titled “Request Body required ”object
Unique dub target languages.
Voice product used for all targets.
Source narration used to produce the dub:
original uses the video’s source transcript and narration;
optimized uses the latest ready Optimize/redub transcript.
Choose optimized only after that workflow is ready.
Optional credit escrow to consume.
Reservation line-item IDs keyed by requested language.
object
Example
{ "languages": [ "es", "de" ], "product": "premium", "sourceVoiceover": "original", "reservationId": "rsv_01JZ9A", "reservationLineItemIdByLanguage": { "es": "li_01", "de": "li_02" }}Responses
Section titled “ Responses ”Dub jobs queued.
object
Parent library video ID.
One queued dub job per language.
object
Deterministic, pollable job ID.
Product workflow represented by the job.
Current normalized job lifecycle state.
Parent video when applicable.
Target language for a dub or caption job.
Dubbing product used by a dub job.
Packaging automation when type is packaging.
Type-specific ready-state artifacts.
object
Terminal failure details when status is failed.
object
Machine-readable job failure code.
Human-readable job failure explanation.
Type-specific identifiers and context.
object
Remaining credit balance when returned by the dubbing service.
Example
{ "videoId": "vid_01JZ8M6A", "jobs": [ { "id": "dub_vid_01JZ8M6A_es_premium", "type": "dub", "status": "queued", "language": "es", "product": "premium" } ], "balance": 254}Request fields are missing, malformed, out of bounds, or mutually inconsistent.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "INVALID_ARGUMENT", "message": "The request contains invalid or missing fields.", "details": {} }}A supported authentication header is missing or contains an invalid Public API key.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Examples
Authentication header missing
{ "error": { "code": "UNAUTHENTICATED", "message": "Missing API key.", "details": {} }}API key invalid
{ "error": { "code": "INVALID_API_KEY", "message": "Invalid API key", "details": {} }}Authentication succeeded, but the required scope, workspace role, or resource permission is missing.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Examples
{ "error": { "code": "INSUFFICIENT_SCOPE", "message": "The API key lacks the required scope.", "details": {} }}The resource does not exist or is not accessible to the caller.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "NOT_FOUND", "message": "Resource not found.", "details": {} }}The Idempotency-Key was reused with a different path or request body.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "IDEMPOTENCY_REPLAY", "message": "Idempotency-Key was reused with a different request.", "details": { "pathMatch": true, "hashMatch": false } }}The account has insufficient credits, or the request exceeded a rate limit.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "INSUFFICIENT_CREDITS", "message": "Not enough credits.", "details": { "required": 60, "available": 20, "shortfall": 40 } }}An unexpected server error occurred.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "INTERNAL", "message": "An unexpected error occurred.", "details": {} }}