curl --request PATCH \
--url https://app.dubly.ai/api/v1/dubs/{id}/segments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_language": "de",
"segments": [
{
"id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
"source_text": "Welcome to our product demo."
},
{
"id": "c9e0d2f1-47ab-4c3e-8f21-6a5b4d3c2e10",
"target_text": "Danke fürs Zuschauen!",
"speaker": "2"
}
],
"also_retranslate_languages": [
"fr"
]
}
'{
"status": "success",
"response": {
"dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"target_language": "de",
"segments": [
{
"id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
"result": "updated",
"api_edits_remaining": 1
},
{
"id": "c9e0d2f1-47ab-4c3e-8f21-6a5b4d3c2e10",
"result": "unchanged",
"api_edits_remaining": 2
}
],
"retranslated_languages": [
"fr"
]
}
}Correct segments of one language
Corrects source text, translation and/or speaker of up to 500 segments of one target language at once, with the web editor’s own save logic. Every entry is checked before anything is written: an unknown, deleted or duplicate segment id, a field the dub’s engine does not allow or an unknown speaker returns 400 naming the segment, and nothing is written.
Engine v1 (per segment): a changed target_text or speaker is saved and voiced at the next POST /api/v1/dubs//update (pending_revoice becomes true); an empty target_text mutes the segment. A changed source_text sent alone is saved and the segment is re-translated and re-voiced in this language right away; sent together with a target_text, both are saved and the given translation is kept. also_retranslate_languages re-translates and re-voices every segment with a changed source_text into those languages too.
Engine v2 (batch): speaker and also_retranslate_languages are not available (400); edits are saved and marked as pending changes, and nothing is re-translated or voiced until POST /api/v1/dubs//update, whose “Apply changes” itself carries corrected source texts over to every language of the dub.
Each entry is reported as “updated”, “unchanged” (all values already as stored: nothing written, nothing counted) or “failed” (with error, not counted); “updated” with an error means the text was saved but the re-translation failed.
While a review is in progress, an update or a lip sync is running for this language (or one in also_retranslate_languages), or a changed segment is being re-translated or re-voiced, the request returns 409 and changes nothing.
Every segment that actually changes costs one of its 2 API edits. See Edit limits. No credits are charged.
curl --request PATCH \
--url https://app.dubly.ai/api/v1/dubs/{id}/segments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_language": "de",
"segments": [
{
"id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
"source_text": "Welcome to our product demo."
},
{
"id": "c9e0d2f1-47ab-4c3e-8f21-6a5b4d3c2e10",
"target_text": "Danke fürs Zuschauen!",
"speaker": "2"
}
],
"also_retranslate_languages": [
"fr"
]
}
'{
"status": "success",
"response": {
"dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"target_language": "de",
"segments": [
{
"id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
"result": "updated",
"api_edits_remaining": 1
},
{
"id": "c9e0d2f1-47ab-4c3e-8f21-6a5b4d3c2e10",
"result": "unchanged",
"api_edits_remaining": 2
}
],
"retranslated_languages": [
"fr"
]
}
}Authorizations
Path Parameters
Body
BCP 47 code of the language whose segments are corrected. A language the dub does not have returns 404.
af, ar, hy, as, az, be, bn, bs, bg, ca, ceb, ny, zh, hr, cs, da, nl, en, et, fil, fi, fr, gl, ka, de, el, gu, ha, he, hi, hu, is, id, ga, it, ja, jv, kn, kk, ko, ky, lv, ln, lt, lb, mk, ms, ml, mr, ne, no, ps, fa, pl, pt, pa, ro, ru, sr, sd, sk, sl, so, es, sw, sv, ta, te, th, tr, uk, ur, vi, cy, en-GB, en-US, es-419, es-ES Engine v1: other languages of the dub into which every segment whose source_text changed is re-translated and re-voiced as well (the editor's "Apply to languages"). Must not contain target_language; muted segments there stay muted. A language the dub does not have returns 400. Each segment re-translated there costs one of its API edits. Engine v2: 400 — the update carries source corrections over to every language by itself.
af, ar, hy, as, az, be, bn, bs, bg, ca, ceb, ny, zh, hr, cs, da, nl, en, et, fil, fi, fr, gl, ka, de, el, gu, ha, he, hi, hu, is, id, ga, it, ja, jv, kn, kk, ko, ky, lv, ln, lt, lb, mk, ms, ml, mr, ne, no, ps, fa, pl, pt, pa, ro, ru, sr, sd, sk, sl, so, es, sw, sv, ta, te, th, tr, uk, ur, vi, cy, en-GB, en-US, es-419, es-ES 
