{
  "openapi": "3.1.0",
  "info": {
    "title": "Dubly API",
    "version": "1.0.0",
    "description": "The Dubly public API creates, edits and downloads AI-dubbed videos. Every request authenticates with an API token as a Bearer token ([Authentication](/authentication)). Every answer is JSON in an envelope: `{ \"status\": \"success\", \"response\": … }` on success, `{ \"status\": \"error\", \"message\": … }` on failure — see [Errors](/guides/errors)."
  },
  "servers": [
    {
      "url": "https://app.dubly.ai",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Create dubs",
      "description": "Start a dub from a YouTube video, a Google Drive file or a public video URL."
    },
    {
      "name": "Dubs",
      "description": "Read a dub's status and results, rename, move or delete it, list its downloads and set the original-voice volume."
    },
    {
      "name": "Dub editing",
      "description": "Read and correct segments, edit the timeline, re-voice a segment and apply the changes with an update. See [Edit limits](/guides/edit-limits)."
    },
    {
      "name": "Lip sync",
      "description": "Start lip sync for a language, follow its progress and switch lip sync per block."
    },
    {
      "name": "Subtitled video",
      "description": "Burn subtitles into the video of a language and fetch the result."
    },
    {
      "name": "Account",
      "description": "List the projects and custom voices of your account."
    }
  ],
  "paths": {
    "/api/v1/dubs/youtube": {
      "post": {
        "operationId": "create-dub-youtube",
        "tags": [
          "Create dubs"
        ],
        "summary": "Create a dub from a YouTube video",
        "description": "Downloads the video from YouTube, extracts metadata, charges credits based on duration, and starts the dubbing pipeline.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "yt_link": {
                    "type": "string",
                    "format": "uri",
                    "description": "Full YouTube video URL (youtube.com, www.youtube.com, m.youtube.com or youtu.be). A link without a video ID returns 400."
                  },
                  "source_language": {
                    "type": "string",
                    "enum": [
                      "af",
                      "sq",
                      "am",
                      "ar",
                      "hy",
                      "as",
                      "az",
                      "ba",
                      "eu",
                      "be",
                      "bn",
                      "bs",
                      "br",
                      "bg",
                      "ca",
                      "zh",
                      "hr",
                      "cs",
                      "da",
                      "nl",
                      "en",
                      "et",
                      "fo",
                      "fi",
                      "fr",
                      "gl",
                      "ka",
                      "de",
                      "el",
                      "gu",
                      "ht",
                      "ha",
                      "haw",
                      "he",
                      "hi",
                      "hu",
                      "is",
                      "id",
                      "it",
                      "ja",
                      "jv",
                      "kn",
                      "kk",
                      "km",
                      "ko",
                      "lo",
                      "la",
                      "lv",
                      "ln",
                      "lt",
                      "lb",
                      "mk",
                      "mg",
                      "ms",
                      "ml",
                      "mt",
                      "mi",
                      "mr",
                      "mn",
                      "my",
                      "ne",
                      "no",
                      "nn",
                      "oc",
                      "ps",
                      "fa",
                      "pl",
                      "pt",
                      "pa",
                      "ro",
                      "ru",
                      "sa",
                      "sr",
                      "sn",
                      "sd",
                      "si",
                      "sk",
                      "sl",
                      "so",
                      "es",
                      "su",
                      "sw",
                      "sv",
                      "tl",
                      "tg",
                      "ta",
                      "tt",
                      "te",
                      "th",
                      "bo",
                      "tr",
                      "tk",
                      "uk",
                      "ur",
                      "uz",
                      "vi",
                      "cy",
                      "wo",
                      "yi",
                      "yo"
                    ],
                    "description": "BCP 47 language code of the original video (e.g. \"en\", \"de\") — one of the source language codes this field lists."
                  },
                  "target_languages": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "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"
                      ]
                    },
                    "description": "Array of BCP 47 target language codes to dub into, at least one — see [Supported target languages](/guides/supported-languages). Engine v1, the default, accepts every code. Every other engine accepts only the codes with ✓ in its column of that table; a code with — there is rejected with 400 when the dub runs on that engine."
                  },
                  "enhance_speech": {
                    "default": false,
                    "type": "boolean",
                    "description": "Accepted for compatibility, but currently without effect: the value is checked to be a boolean and otherwise ignored — no speech enhancement is applied either way. Defaults to false."
                  },
                  "speaker_count": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20,
                    "description": "Number of speakers in the video (0–20). Defaults to 0 (auto-detect)."
                  },
                  "title": {
                    "default": "Untitled",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Title for the dub. Leading and trailing spaces are removed; the rest must be 1–500 characters, otherwise 400. Defaults to \"Untitled\"; left at that, the dub takes the title of the YouTube video."
                  },
                  "custom_prompt": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Custom instructions for the translation (max 2000 chars)."
                  },
                  "translation_style_map": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "description": "Map of target language code to translation style ID (UUID). Assigns a specific style per language."
                  },
                  "auto_apply_styles": {
                    "default": true,
                    "type": "boolean",
                    "description": "Auto-match translation styles for languages not in the map. Defaults to true."
                  },
                  "engine": {
                    "type": "string",
                    "enum": [
                      "v1",
                      "v2"
                    ],
                    "description": "Dubbing engine, one of \"v1\", \"v2\". Defaults to \"v1\". \"v2\" must be enabled for your account; otherwise the request returns 403 and no dub is created. Each engine offers its own target languages ([Supported target languages](/guides/supported-languages))."
                  },
                  "project_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Assigns the dub to a project owned by your account. Retrieve project IDs via GET /api/v1/projects. An unknown project or one of another account returns 400."
                  },
                  "custom_voice_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Uses a custom voice for text-to-speech. The same voice is used for all speakers. Retrieve custom voice IDs via GET /api/v1/custom-voices. An unknown custom voice or one of another account returns 400."
                  },
                  "keep_original_voice": {
                    "default": false,
                    "type": "boolean",
                    "description": "Keep the original voice under the dubbed voice. Not supported through the public API yet: only false, the default, is accepted — true returns 400."
                  },
                  "original_voice_volume_db": {
                    "default": -20,
                    "type": "integer",
                    "minimum": -30,
                    "maximum": -5,
                    "description": "Volume of the original voice under the dubbed voice in dB, a whole number from -30 (quietest) to -5 (loudest). Defaults to -20. It is stored with the dub, but only heard on a dub that keeps the original voice — which the public API cannot create yet (see keep_original_voice)."
                  }
                },
                "required": [
                  "yt_link",
                  "source_language",
                  "target_languages"
                ]
              },
              "examples": {
                "youtube": {
                  "summary": "A YouTube video into two languages",
                  "value": {
                    "yt_link": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
                    "source_language": "en",
                    "target_languages": [
                      "de",
                      "fr"
                    ],
                    "title": "My Video",
                    "speaker_count": 1,
                    "project_id": "83724e4d-f41a-4f1a-a4c3-590e6b296bb0",
                    "custom_voice_id": "1fd47408-c5ff-4de0-97b1-f37c7372710e"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The dub was created. Poll GET /api/v1/dubs/{id} with its id for the status and the results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID of the new dub — the {id} of every /api/v1/dubs/{id} endpoint."
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "created": {
                    "summary": "The new dub",
                    "value": {
                      "status": "success",
                      "response": {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The body is not valid JSON or fails validation (a missing or invalid field, keep_original_voice: true), project_id or custom_voice_id is not one of your account's, or a target language is not offered by the dub's engine. No dub is created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — Your credits do not cover the dub, or the requested engine is not enabled for your account. A refused engine creates no dub; without enough credits the dub has already been created — it gets status \"Error\" and nothing is charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — YouTube reports the video as not found or unavailable. No dub is created and no credits are charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub could not be created. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/google-drive": {
      "post": {
        "operationId": "create-dub-google-drive",
        "tags": [
          "Create dubs"
        ],
        "summary": "Create a dub from a Google Drive video",
        "description": "Checks the Google Drive file, takes its name and duration, charges credits based on that duration, and starts the dubbing pipeline. The file must be shared as \"Anyone with the link\" with downloading allowed.\n\nA file that is not found or not shared publicly returns 404; a folder, a non-video file, a file with downloading disabled or a video Drive is still processing returns 400; if Google Drive cannot be reached the request returns 500 and can be retried. In each of these refused cases no dub is created and no credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "drive_link": {
                    "type": "string",
                    "description": "Google Drive file link, e.g. https://drive.google.com/file/d/<id>/view (also /open?id=, /uc?id= and drive.usercontent.google.com/download?id=). Folder links are rejected. If the link contains a resourcekey, keep it."
                  },
                  "source_language": {
                    "type": "string",
                    "enum": [
                      "af",
                      "sq",
                      "am",
                      "ar",
                      "hy",
                      "as",
                      "az",
                      "ba",
                      "eu",
                      "be",
                      "bn",
                      "bs",
                      "br",
                      "bg",
                      "ca",
                      "zh",
                      "hr",
                      "cs",
                      "da",
                      "nl",
                      "en",
                      "et",
                      "fo",
                      "fi",
                      "fr",
                      "gl",
                      "ka",
                      "de",
                      "el",
                      "gu",
                      "ht",
                      "ha",
                      "haw",
                      "he",
                      "hi",
                      "hu",
                      "is",
                      "id",
                      "it",
                      "ja",
                      "jv",
                      "kn",
                      "kk",
                      "km",
                      "ko",
                      "lo",
                      "la",
                      "lv",
                      "ln",
                      "lt",
                      "lb",
                      "mk",
                      "mg",
                      "ms",
                      "ml",
                      "mt",
                      "mi",
                      "mr",
                      "mn",
                      "my",
                      "ne",
                      "no",
                      "nn",
                      "oc",
                      "ps",
                      "fa",
                      "pl",
                      "pt",
                      "pa",
                      "ro",
                      "ru",
                      "sa",
                      "sr",
                      "sn",
                      "sd",
                      "si",
                      "sk",
                      "sl",
                      "so",
                      "es",
                      "su",
                      "sw",
                      "sv",
                      "tl",
                      "tg",
                      "ta",
                      "tt",
                      "te",
                      "th",
                      "bo",
                      "tr",
                      "tk",
                      "uk",
                      "ur",
                      "uz",
                      "vi",
                      "cy",
                      "wo",
                      "yi",
                      "yo"
                    ],
                    "description": "BCP 47 language code of the original video (e.g. \"en\", \"de\") — one of the source language codes this field lists."
                  },
                  "target_languages": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "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"
                      ]
                    },
                    "description": "Array of BCP 47 target language codes to dub into, at least one — see [Supported target languages](/guides/supported-languages). Engine v1, the default, accepts every code. Every other engine accepts only the codes with ✓ in its column of that table; a code with — there is rejected with 400 when the dub runs on that engine."
                  },
                  "enhance_speech": {
                    "default": false,
                    "type": "boolean",
                    "description": "Accepted for compatibility, but currently without effect: the value is checked to be a boolean and otherwise ignored — no speech enhancement is applied either way. Defaults to false."
                  },
                  "speaker_count": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20,
                    "description": "Number of speakers in the video (0–20). Defaults to 0 (auto-detect)."
                  },
                  "title": {
                    "default": "Untitled",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Title for the dub. Leading and trailing spaces are removed; the rest must be 1–500 characters, otherwise 400. Defaults to \"Untitled\"; left at that, the dub takes the name of the Drive file (trimmed, at most 500 characters)."
                  },
                  "custom_prompt": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Custom instructions for the translation (max 2000 chars)."
                  },
                  "translation_style_map": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "description": "Map of target language code to translation style ID (UUID). Assigns a specific style per language."
                  },
                  "auto_apply_styles": {
                    "default": true,
                    "type": "boolean",
                    "description": "Auto-match translation styles for languages not in the map. Defaults to true."
                  },
                  "engine": {
                    "type": "string",
                    "enum": [
                      "v1",
                      "v2"
                    ],
                    "description": "Dubbing engine, one of \"v1\", \"v2\". Defaults to \"v1\". \"v2\" must be enabled for your account; otherwise the request returns 403 and no dub is created. Each engine offers its own target languages ([Supported target languages](/guides/supported-languages))."
                  },
                  "project_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Assigns the dub to a project owned by your account. Retrieve project IDs via GET /api/v1/projects. An unknown project or one of another account returns 400."
                  },
                  "custom_voice_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Uses a custom voice for text-to-speech. The same voice is used for all speakers. Retrieve custom voice IDs via GET /api/v1/custom-voices. An unknown custom voice or one of another account returns 400."
                  },
                  "keep_original_voice": {
                    "default": false,
                    "type": "boolean",
                    "description": "Keep the original voice under the dubbed voice. Not supported through the public API yet: only false, the default, is accepted — true returns 400."
                  },
                  "original_voice_volume_db": {
                    "default": -20,
                    "type": "integer",
                    "minimum": -30,
                    "maximum": -5,
                    "description": "Volume of the original voice under the dubbed voice in dB, a whole number from -30 (quietest) to -5 (loudest). Defaults to -20. It is stored with the dub, but only heard on a dub that keeps the original voice — which the public API cannot create yet (see keep_original_voice)."
                  }
                },
                "required": [
                  "drive_link",
                  "source_language",
                  "target_languages"
                ]
              },
              "examples": {
                "googleDrive": {
                  "summary": "A Drive video into two languages",
                  "value": {
                    "drive_link": "https://drive.google.com/file/d/1AbCdEfGhIjKlMnOpQrStUvWxYz012345/view",
                    "source_language": "en",
                    "target_languages": [
                      "de",
                      "fr"
                    ],
                    "project_id": "83724e4d-f41a-4f1a-a4c3-590e6b296bb0"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The dub was created. Poll GET /api/v1/dubs/{id} with its id for the status and the results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID of the new dub — the {id} of every /api/v1/dubs/{id} endpoint."
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "created": {
                    "summary": "The new dub",
                    "value": {
                      "status": "success",
                      "response": {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The body is not valid JSON or fails validation (a missing or invalid field, keep_original_voice: true), project_id or custom_voice_id is not one of your account's, or a target language is not offered by the dub's engine. No dub is created. Also when drive_link is not a Drive file link (e.g. a folder), or the file is not a video, has downloading disabled or is still being processed by Drive.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — Your credits do not cover the dub, or the requested engine is not enabled for your account. A refused engine creates no dub; without enough credits the dub has already been created — it gets status \"Error\" and nothing is charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — The Google Drive file is not found or not shared publicly — set its sharing to \"Anyone with the link\". No dub is created and no credits are charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — Google Drive could not be reached, or the dub could not be created. Retry the request; when Drive was unreachable, no dub is created and no credits are charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/url": {
      "post": {
        "operationId": "create-dub-url",
        "tags": [
          "Create dubs"
        ],
        "summary": "Create a dub from a video URL",
        "description": "Creates a dub from a publicly accessible video URL. A minimum credit charge (1 minute per language) is applied upfront — additional credits are charged once the actual duration is known.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "video_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public URL of the video file."
                  },
                  "video_key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Filename of the video (e.g. \"my-video.mp4\", 1–500 chars). It is stored with the dub for reference only; Dubly stores the downloaded video under its own internal path."
                  },
                  "source_language": {
                    "type": "string",
                    "enum": [
                      "af",
                      "sq",
                      "am",
                      "ar",
                      "hy",
                      "as",
                      "az",
                      "ba",
                      "eu",
                      "be",
                      "bn",
                      "bs",
                      "br",
                      "bg",
                      "ca",
                      "zh",
                      "hr",
                      "cs",
                      "da",
                      "nl",
                      "en",
                      "et",
                      "fo",
                      "fi",
                      "fr",
                      "gl",
                      "ka",
                      "de",
                      "el",
                      "gu",
                      "ht",
                      "ha",
                      "haw",
                      "he",
                      "hi",
                      "hu",
                      "is",
                      "id",
                      "it",
                      "ja",
                      "jv",
                      "kn",
                      "kk",
                      "km",
                      "ko",
                      "lo",
                      "la",
                      "lv",
                      "ln",
                      "lt",
                      "lb",
                      "mk",
                      "mg",
                      "ms",
                      "ml",
                      "mt",
                      "mi",
                      "mr",
                      "mn",
                      "my",
                      "ne",
                      "no",
                      "nn",
                      "oc",
                      "ps",
                      "fa",
                      "pl",
                      "pt",
                      "pa",
                      "ro",
                      "ru",
                      "sa",
                      "sr",
                      "sn",
                      "sd",
                      "si",
                      "sk",
                      "sl",
                      "so",
                      "es",
                      "su",
                      "sw",
                      "sv",
                      "tl",
                      "tg",
                      "ta",
                      "tt",
                      "te",
                      "th",
                      "bo",
                      "tr",
                      "tk",
                      "uk",
                      "ur",
                      "uz",
                      "vi",
                      "cy",
                      "wo",
                      "yi",
                      "yo"
                    ],
                    "description": "BCP 47 language code of the original video (e.g. \"en\", \"de\") — one of the source language codes this field lists."
                  },
                  "target_languages": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "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"
                      ]
                    },
                    "description": "Array of BCP 47 target language codes to dub into, at least one — see [Supported target languages](/guides/supported-languages). Engine v1, the default, accepts every code. Every other engine accepts only the codes with ✓ in its column of that table; a code with — there is rejected with 400 when the dub runs on that engine."
                  },
                  "enhance_speech": {
                    "default": false,
                    "type": "boolean",
                    "description": "Accepted for compatibility, but currently without effect: the value is checked to be a boolean and otherwise ignored — no speech enhancement is applied either way. Defaults to false."
                  },
                  "speaker_count": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20,
                    "description": "Number of speakers in the video (0–20). Defaults to 0 (auto-detect)."
                  },
                  "title": {
                    "default": "Untitled",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Title for the dub. Leading and trailing spaces are removed; the rest must be 1–500 characters, otherwise 400. Defaults to \"Untitled\"."
                  },
                  "custom_prompt": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Custom instructions for the translation (max 2000 chars)."
                  },
                  "translation_style_map": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "description": "Map of target language code to translation style ID (UUID). Assigns a specific style per language."
                  },
                  "auto_apply_styles": {
                    "default": true,
                    "type": "boolean",
                    "description": "Auto-match translation styles for languages not in the map. Defaults to true."
                  },
                  "engine": {
                    "type": "string",
                    "enum": [
                      "v1",
                      "v2"
                    ],
                    "description": "Dubbing engine, one of \"v1\", \"v2\". Defaults to \"v1\". \"v2\" must be enabled for your account; otherwise the request returns 403 and no dub is created. Each engine offers its own target languages ([Supported target languages](/guides/supported-languages))."
                  },
                  "project_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Assigns the dub to a project owned by your account. Retrieve project IDs via GET /api/v1/projects. An unknown project or one of another account returns 400."
                  },
                  "custom_voice_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Uses a custom voice for text-to-speech. The same voice is used for all speakers. Retrieve custom voice IDs via GET /api/v1/custom-voices. An unknown custom voice or one of another account returns 400."
                  },
                  "keep_original_voice": {
                    "default": false,
                    "type": "boolean",
                    "description": "Keep the original voice under the dubbed voice. Not supported through the public API yet: only false, the default, is accepted — true returns 400."
                  },
                  "original_voice_volume_db": {
                    "default": -20,
                    "type": "integer",
                    "minimum": -30,
                    "maximum": -5,
                    "description": "Volume of the original voice under the dubbed voice in dB, a whole number from -30 (quietest) to -5 (loudest). Defaults to -20. It is stored with the dub, but only heard on a dub that keeps the original voice — which the public API cannot create yet (see keep_original_voice)."
                  }
                },
                "required": [
                  "video_url",
                  "video_key",
                  "source_language",
                  "target_languages"
                ]
              },
              "examples": {
                "url": {
                  "summary": "A video URL into two languages",
                  "value": {
                    "video_url": "https://example.com/video.mp4",
                    "video_key": "my-video.mp4",
                    "source_language": "en",
                    "target_languages": [
                      "de",
                      "es"
                    ],
                    "title": "My Video",
                    "project_id": "83724e4d-f41a-4f1a-a4c3-590e6b296bb0",
                    "custom_voice_id": "1fd47408-c5ff-4de0-97b1-f37c7372710e"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The dub was created. Poll GET /api/v1/dubs/{id} with its id for the status and the results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID of the new dub — the {id} of every /api/v1/dubs/{id} endpoint."
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "created": {
                    "summary": "The new dub",
                    "value": {
                      "status": "success",
                      "response": {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The body is not valid JSON or fails validation (a missing or invalid field, keep_original_voice: true), project_id or custom_voice_id is not one of your account's, or a target language is not offered by the dub's engine. No dub is created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — Your credits do not cover the dub, or the requested engine is not enabled for your account. A refused engine creates no dub; without enough credits the dub has already been created — it gets status \"Error\" and nothing is charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub could not be created. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}": {
      "get": {
        "operationId": "get-dub",
        "tags": [
          "Dubs"
        ],
        "summary": "Get dub status and result URLs",
        "description": "Check the current status of a dub. Returns \"Processing\" while in progress, \"Dubbed\" with download URLs when complete, or \"Error\" if the dub failed. After a change in the editor (\"Update\"), the dub is re-rendered: the status is \"Updating\" without URLs until the new version is ready, then \"Dubbed\" again with URLs to the updated video. A change of the original-voice volume (PATCH /api/v1/dubs/{id}/audio-settings) on a finished dub does the same while its languages are re-mixed: \"Updating\" without URLs, then \"Dubbed\" again. An update also resets a finished lip sync of that language (GET /api/v1/dubs/{id}/lipsync answers \"NotStarted\") — start it again once the status is \"Dubbed\". See [Dub status lifecycle](/guides/dub-status).\n\nDownload URLs are signed and valid for 7 days; download the file instead of storing the link, and call this endpoint again for a fresh one.\n\nEvery answer, in every status, also carries audio_settings: original_voice_volume_db (the volume of the original voice under the dubbed one, in dB), adjustable (whether PATCH /api/v1/dubs/{id}/audio-settings can change it for this dub) and api_changes_remaining (API volume changes left for this dub; null if it cannot be read at the moment — the rest of the answer is unaffected).\n\nThe dub ID is passed as a path parameter; a deleted dub returns 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID returned by the create endpoint (path parameter). An unknown dub, a dub of another account and a deleted dub return 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "responses": {
          "200": {
            "description": "The dub's status, its result URLs once it is \"Dubbed\", and its audio settings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "Processing",
                            "Updating",
                            "Dubbed",
                            "Error"
                          ],
                          "description": "\"Processing\", \"Updating\" (re-rendered after an update or re-mixed after a volume change, no URLs), \"Dubbed\" or \"Error\" — see [Dub status lifecycle](/guides/dub-status)."
                        },
                        "url": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Only when status is \"Dubbed\": signed URLs of the final videos, one per target language, valid for 7 days."
                        },
                        "audio_settings": {
                          "type": "object",
                          "properties": {
                            "original_voice_volume_db": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "The volume of the original voice under the dubbed one, in dB."
                            },
                            "adjustable": {
                              "type": "boolean",
                              "description": "Whether PATCH /api/v1/dubs/{id}/audio-settings can change it for this dub. Always false for a dub created through the API, which cannot keep the original voice yet (see keep_original_voice of the create endpoints)."
                            },
                            "api_changes_remaining": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "API volume changes left for this dub (of 2); null if it cannot be read at the moment — the rest of the answer is unaffected."
                            }
                          },
                          "required": [
                            "original_voice_volume_db",
                            "adjustable",
                            "api_changes_remaining"
                          ],
                          "description": "The original-voice volume of the dub — in every status."
                        }
                      },
                      "required": [
                        "status",
                        "audio_settings"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "processing": {
                    "summary": "Processing",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Processing",
                        "audio_settings": {
                          "original_voice_volume_db": -20,
                          "adjustable": false,
                          "api_changes_remaining": 2
                        }
                      }
                    }
                  },
                  "updating": {
                    "summary": "Re-rendering after an editor update (no URLs until done)",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Updating",
                        "audio_settings": {
                          "original_voice_volume_db": -20,
                          "adjustable": false,
                          "api_changes_remaining": 2
                        }
                      }
                    }
                  },
                  "dubbed": {
                    "summary": "Completed (signed URLs, valid for 7 days)",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Dubbed",
                        "url": [
                          "https://...amazonaws.com/.../final_video.mp4?X-Amz-Expires=604800&...",
                          "https://...amazonaws.com/.../final_video.mp4?X-Amz-Expires=604800&..."
                        ],
                        "audio_settings": {
                          "original_voice_volume_db": -20,
                          "adjustable": false,
                          "api_changes_remaining": 2
                        }
                      }
                    }
                  },
                  "error": {
                    "summary": "Failed",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Error",
                        "audio_settings": {
                          "original_voice_volume_db": -20,
                          "adjustable": false,
                          "api_changes_remaining": 2
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — The dub does not exist, belongs to another account or was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub could not be read. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch-dub",
        "tags": [
          "Dubs"
        ],
        "summary": "Rename a dub or move it to a project",
        "description": "Renames the dub and/or moves it into a project, like \"Rename\" and \"Move to project\" in the web app. Send title, project_id or both; a body with neither returns 400. Both are checked before anything is written: if one of them is invalid, neither is changed. A value that is already as stored is not written, so a request that changes nothing returns 200 with the current values. Works in every dub status, with no limit and no review lock. No credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). An unknown dub, a dub of another account and a deleted dub return 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "New title. Leading and trailing spaces are removed; the rest must be 1–500 characters, otherwise 400."
                  },
                  "project_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Project to move the dub into — a project of your account (see GET /api/v1/projects). An unknown project or one of another account returns 404. null takes the dub out of its project."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "renameAndMove": {
                  "summary": "Rename and move into a project",
                  "value": {
                    "title": "Product Tour (DE)",
                    "project_id": "83724e4d-f41a-4f1a-a4c3-590e6b296bb0"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The dub's title and project after the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "project_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The dub's project, or null when it is in none."
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "project_id"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "renamedAndMoved": {
                    "summary": "Renamed and moved",
                    "value": {
                      "status": "success",
                      "response": {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "title": "Product Tour (DE)",
                        "project_id": "83724e4d-f41a-4f1a-a4c3-590e6b296bb0"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID. Or the body is not valid JSON, has neither title nor project_id, has another field, or a value is invalid (a blank title or one longer than 500 characters, a project_id that is no UUID). Nothing is changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — The dub does not exist, belongs to another account or was deleted. Or project_id is an unknown project or one of another account. Nothing is changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub or the project could not be read, or the change could not be saved — nothing was changed. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-dub",
        "tags": [
          "Dubs"
        ],
        "summary": "Delete a dub permanently",
        "description": "Deletes the dub with all its languages, segments and stored files (videos, audio, subtitles, lip syncs), like \"Delete\" in the web app.\n\nDeleting is permanent and cannot be undone: there is no trash and no restore, neither through the API nor in the web app — download everything you still need first (GET /api/v1/dubs/{id}/downloads). Afterwards GET /api/v1/dubs/{id}, every other endpoint for this ID and a second DELETE return 404.\n\nWorks in every dub status, with no limit and no review lock.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). An unknown dub, a dub of another account and a deleted dub return 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "responses": {
          "200": {
            "description": "The dub is deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "deleted": {
                          "type": "boolean",
                          "const": true,
                          "description": "Always true."
                        }
                      },
                      "required": [
                        "id",
                        "deleted"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "deleted": {
                    "summary": "Deleted",
                    "value": {
                      "status": "success",
                      "response": {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "deleted": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — The dub does not exist, belongs to another account or was deleted. A second DELETE of the same dub returns 404 as well.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub could not be read or deleted. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/downloads": {
      "get": {
        "operationId": "get-dub-downloads",
        "tags": [
          "Dubs"
        ],
        "summary": "List the downloads of one language",
        "description": "Returns exactly the files the Download tab of the web app offers for one target language of a completed dub. Each entry has id, file_name (the same file name as a download in the web app), a signed url and expires_at (ISO 8601): the link is valid for 1 hour — the same as a download in the web app — and stops working at expires_at — download the file, and call this endpoint again for a fresh link.\n\nThe ids:\n- \"video\" (final video) and \"audio\" (final audio) always;\n- \"lipsync\" only when the lip sync of this language is finished (\"Synced\");\n- \"audio-voice\" (dubbed voice only) and \"audio-background\" (background without voices) only on an engine with separate audio tracks, and only once those tracks are ready — on a v2 dub the background is the language's own and its file_name carries the language like every other entry (e.g. My_Video_de_background.mp3); a dub created before per-language backgrounds has one background for all languages, without the language (My_Video_background.mp3);\n- \"subtitled-video\" only when its burn-in is \"ready\" (see POST /api/v1/dubs/{id}/subtitled-video).\n\nAn option that is not available is left out; subtitle files (SRT) are not offered. \"video\", \"lipsync\" and \"subtitled-video\" pass the same integrity check as a download in the web app: a damaged file stays in the list with url null, expires_at null and error \"video_corrupted\" instead of silently missing.\n\nA dub that has not finished processing returns 400; an unknown dub, a dub of another account and a target_language the dub does not have return 404. Read-only: nothing is counted, there is no limit and no credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          {
            "name": "target_language",
            "in": "query",
            "required": true,
            "description": "BCP 47 target language code of the language to read (query parameter, e.g. ?target_language=de). A language the dub does not have returns 404.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "de"
          }
        ],
        "responses": {
          "200": {
            "description": "The downloadable files of the language, in the order of the web app's Download tab.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "downloads": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "enum": [
                                  "video",
                                  "audio",
                                  "audio-voice",
                                  "audio-background",
                                  "lipsync",
                                  "subtitled-video"
                                ],
                                "description": "\"video\", \"audio\", \"audio-voice\", \"audio-background\", \"lipsync\" or \"subtitled-video\" — see the description for when each is listed."
                              },
                              "file_name": {
                                "type": "string",
                                "description": "The same file name as a download in the web app."
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Signed download link, valid for 1 hour; null when the file failed the integrity check."
                              },
                              "expires_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "When url stops working (ISO 8601); null when the file failed the integrity check."
                              },
                              "error": {
                                "type": "string",
                                "const": "video_corrupted",
                                "description": "Only on a damaged video: \"video_corrupted\"."
                              }
                            },
                            "required": [
                              "id",
                              "file_name",
                              "url",
                              "expires_at"
                            ]
                          }
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "downloads"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "downloads": {
                    "summary": "A v2 dub with a damaged burned-in video",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "downloads": [
                          {
                            "id": "video",
                            "file_name": "My_Video_de_final_video.mp4",
                            "url": "https://...amazonaws.com/.../final_video.mp4?X-Amz-Signature=...",
                            "expires_at": "2026-11-24T13:00:00.000Z"
                          },
                          {
                            "id": "audio",
                            "file_name": "My_Video_de_final_audio.mp3",
                            "url": "https://...amazonaws.com/.../final_audio.mp3?X-Amz-Signature=...",
                            "expires_at": "2026-11-24T13:00:00.000Z"
                          },
                          {
                            "id": "audio-voice",
                            "file_name": "My_Video_de_voice.mp3",
                            "url": "https://...amazonaws.com/.../merged_audio.mp3?X-Amz-Signature=...",
                            "expires_at": "2026-11-24T13:00:00.000Z"
                          },
                          {
                            "id": "audio-background",
                            "file_name": "My_Video_de_background.mp3",
                            "url": "https://...amazonaws.com/.../background.mp3?X-Amz-Signature=...",
                            "expires_at": "2026-11-24T13:00:00.000Z"
                          },
                          {
                            "id": "subtitled-video",
                            "file_name": "My_Video_de_subtitled_video.mp4",
                            "url": null,
                            "expires_at": null,
                            "error": "video_corrupted"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID. Or target_language is missing or not a supported target language code, or the dub has not finished processing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — The dub does not exist, belongs to another account or was deleted. Or the dub has no language target_language.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub could not be read or the download links could not be created. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/audio-settings": {
      "patch": {
        "operationId": "patch-dub-audio-settings",
        "tags": [
          "Dubs"
        ],
        "summary": "Change the volume of the original voice",
        "description": "Sets how loud the original voice plays under the dubbed voice, like the audio settings on the dub page of the web app. The value is saved for the dub; if the dub has finished processing, every language is re-mixed with it right away — nothing is re-voiced and no credits are charged. While the re-mix runs, GET /api/v1/dubs/{id} reports \"Updating\" without URLs; once it is done, \"Dubbed\" again with URLs to the re-mixed videos. A finished lip sync is not reset by a volume change: GET /api/v1/dubs/{id}/lipsync stays \"Synced\", and its video is not re-made with the new volume.\n\nPossible only when the dub's engine supports it and the dub was created keeping the original voice under the dubbed one (audio_settings.adjustable in GET /api/v1/dubs/{id}); otherwise the request returns 400. A value that is not a whole number from -30 to -5 returns 400. While any language of the dub is being updated or a review is in progress, the request returns 409 and changes nothing. Sending the current value returns 200 without a re-mix and is not counted.\n\nEvery change that actually takes effect costs one of the dub's 2 API volume changes; once they are used up, the next change returns 403 FORBIDDEN — the value and the audio stay as they are, and the volume can still be changed in the Dubly web app. A request refused with 400, 403, 404 or 409 before anything is written is not counted, and neither is one whose save fails with 500. Once the new value is saved, the change counts even if the re-mix does not finish: if another change was re-mixing a language at the same moment, the request returns 409, and if the re-mix fails, 500 — in both cases the new value stays saved and the message says so. See [Edit limits](/guides/edit-limits).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). An unknown dub, a dub of another account and a deleted dub return 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "original_voice_volume_db": {
                    "type": "integer",
                    "minimum": -30,
                    "maximum": -5,
                    "description": "Volume of the original voice in dB, a whole number from -30 (quietest) to -5 (loudest). A new dub starts at -20."
                  }
                },
                "required": [
                  "original_voice_volume_db"
                ],
                "additionalProperties": false
              },
              "examples": {
                "volume": {
                  "summary": "Set the original voice volume",
                  "value": {
                    "original_voice_volume_db": -15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The value is saved and — for a finished dub — every language is re-mixed; or the value was already set.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "original_voice_volume_db": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The dub's original-voice volume now, in dB."
                        },
                        "api_changes_remaining": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991,
                          "description": "API volume changes this dub has left (of 2)."
                        }
                      },
                      "required": [
                        "original_voice_volume_db",
                        "api_changes_remaining"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "changed": {
                    "summary": "Changed, one API volume change used",
                    "value": {
                      "status": "success",
                      "response": {
                        "original_voice_volume_db": -15,
                        "api_changes_remaining": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID. Or the body is not valid JSON, has another field, or the value is not a whole number from -30 to -5; or the volume of this dub cannot be changed (audio_settings.adjustable is false). Not counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — The dub's 2 API volume changes are used up. Nothing is changed — the volume can still be changed in the Dubly web app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — The dub does not exist, belongs to another account or was deleted. Not counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — A language of the dub is being updated or in review — nothing is changed and nothing is counted. Or the new value was saved and counted, but another change was re-mixing a language at the same moment, so this request could not re-mix it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub or its API usage could not be read, or the value could not be saved — nothing is changed and nothing is counted. Or the new value was saved and counted, but the re-mix failed; after an unexpected error the value may have been saved, and the change is counted. The message says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/segments": {
      "get": {
        "operationId": "get-dub-segments",
        "tags": [
          "Dub editing"
        ],
        "summary": "List the segments of one language",
        "description": "Returns every segment of one target language of a completed dub, sorted by index, with its id (what PATCH …/segments takes), start and end in seconds as the editor shows them, source_text, target_text, speaker, is_muted, speech_rate, pending_revoice (engine v1: edited and waiting to be voiced at the next update; always false on engine v2), processing (a re-translation or re-voicing of this segment is running right now) and api_edits_remaining.\n\nOn the language level it returns the engine, its capabilities (supportsSourceEdit, supportsTranslationEdit and supportsVoiceSwap tell which PATCH fields the engine accepts), speakers (exactly the ids PATCH speaker accepts) and the same render state as GET /api/v1/dubs/{id}/update.\n\nA language without segments returns 200 with an empty segments array. An unknown dub, a dub of another account and a target_language the dub does not have all return 404. Read-only: nothing is counted and no credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          {
            "name": "target_language",
            "in": "query",
            "required": true,
            "description": "BCP 47 target language code of the language to read (query parameter, e.g. ?target_language=de). A language the dub does not have returns 404.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "de"
          }
        ],
        "responses": {
          "200": {
            "description": "The segments, speakers, capabilities and render state of the language.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "engine": {
                          "type": "string",
                          "enum": [
                            "v1",
                            "v2"
                          ],
                          "description": "The engine of the dub. It decides which edits are available (capabilities in GET /api/v1/dubs/{id}/segments)."
                        },
                        "pending_changes": {
                          "type": "boolean",
                          "description": "Edits that POST /api/v1/dubs/{id}/update would apply; v1: segments waiting for an update, v2: changes waiting for \"Apply changes\"."
                        },
                        "is_updating": {
                          "type": "boolean",
                          "description": "An update of this language is running."
                        },
                        "update_status": {
                          "type": "string",
                          "enum": [
                            "idle",
                            "voice_cloning",
                            "speech_syncing",
                            "merging",
                            "rendering",
                            "error"
                          ],
                          "description": "\"idle\", or the running phase voice_cloning → speech_syncing → merging → rendering; \"error\" if the last update failed."
                        },
                        "lipsync_status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Lip-sync status of this language: \"not_started\", \"face_setup\", \"segmenting\", \"processing\", \"reconstructing\", \"done\", \"failed\", or null."
                        },
                        "api_update_rounds_remaining": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "API update rounds left for this language (at most 2)."
                        },
                        "video_url": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Signed URL of the current video, valid for 7 days, like GET /api/v1/dubs/{id}; null while an update is running."
                        },
                        "capabilities": {
                          "type": "object",
                          "properties": {
                            "supportsSourceEdit": {
                              "type": "boolean"
                            },
                            "supportsTranslationEdit": {
                              "type": "boolean"
                            },
                            "supportsVoiceSwap": {
                              "type": "boolean"
                            },
                            "supportsTimelineEditor": {
                              "type": "boolean"
                            },
                            "supportsPerSegmentRegenerate": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "supportsSourceEdit",
                            "supportsTranslationEdit",
                            "supportsVoiceSwap",
                            "supportsTimelineEditor",
                            "supportsPerSegmentRegenerate"
                          ],
                          "description": "What the engine accepts: supportsSourceEdit, supportsTranslationEdit and supportsVoiceSwap tell which PATCH fields the engine accepts; supportsTimelineEditor and supportsPerSegmentRegenerate whether POST …/segments/timeline and POST …/regenerate are available."
                        },
                        "speakers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ]
                          },
                          "description": "Exactly the ids PATCH speaker accepts."
                        },
                        "segments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "What PATCH …/segments takes."
                              },
                              "index": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "start": {
                                "type": "number",
                                "description": "Start in seconds, as the editor shows it."
                              },
                              "end": {
                                "type": "number",
                                "description": "End in seconds, as the editor shows it."
                              },
                              "source_text": {
                                "type": "string"
                              },
                              "target_text": {
                                "type": "string"
                              },
                              "speaker": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ]
                              },
                              "is_muted": {
                                "type": "boolean"
                              },
                              "speech_rate": {
                                "type": "number",
                                "description": "Speech rate (1 = normal)."
                              },
                              "pending_revoice": {
                                "type": "boolean",
                                "description": "Engine v1: edited and waiting to be voiced at the next update; always false on engine v2."
                              },
                              "processing": {
                                "type": "boolean",
                                "description": "A re-translation or re-voicing of this segment is running right now."
                              },
                              "api_edits_remaining": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991,
                                "description": "API edits left for this segment (at most 2)."
                              }
                            },
                            "required": [
                              "id",
                              "index",
                              "start",
                              "end",
                              "source_text",
                              "target_text",
                              "speaker",
                              "is_muted",
                              "speech_rate",
                              "pending_revoice",
                              "processing",
                              "api_edits_remaining"
                            ]
                          },
                          "description": "Every segment of the language, sorted by index; empty for a language without segments."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "engine",
                        "pending_changes",
                        "is_updating",
                        "update_status",
                        "lipsync_status",
                        "api_update_rounds_remaining",
                        "video_url",
                        "capabilities",
                        "speakers",
                        "segments"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "segments": {
                    "summary": "An engine v1 language",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "engine": "v1",
                        "pending_changes": false,
                        "is_updating": false,
                        "update_status": "idle",
                        "lipsync_status": "not_started",
                        "api_update_rounds_remaining": 2,
                        "video_url": "https://...amazonaws.com/.../final_video.mp4?X-Amz-Expires=604800&...",
                        "capabilities": {
                          "supportsSourceEdit": true,
                          "supportsTranslationEdit": true,
                          "supportsVoiceSwap": true,
                          "supportsTimelineEditor": true,
                          "supportsPerSegmentRegenerate": true
                        },
                        "speakers": [
                          {
                            "id": "1",
                            "name": "Speaker 1"
                          },
                          {
                            "id": "2",
                            "name": "Speaker 2"
                          }
                        ],
                        "segments": [
                          {
                            "id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                            "index": 0,
                            "start": 0.48,
                            "end": 3.12,
                            "source_text": "Welcome to our product tour.",
                            "target_text": "Willkommen zu unserer Produkttour.",
                            "speaker": {
                              "id": "1",
                              "name": "Speaker 1"
                            },
                            "is_muted": false,
                            "speech_rate": 1,
                            "pending_revoice": false,
                            "processing": false,
                            "api_edits_remaining": 2
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID, target_language is missing or no supported target language code, or the dub has not finished processing (status \"Dubbed\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub, its segments or its API usage could not be read. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch-dub-segments",
        "tags": [
          "Dub editing"
        ],
        "summary": "Correct segments of one language",
        "description": "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.\n\nEngine v1 (per segment): a changed target_text or speaker is saved and voiced at the next POST /api/v1/dubs/{id}/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.\n\nEngine 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/{id}/update, whose \"Apply changes\" itself carries corrected source texts over to every language of the dub.\n\nEach 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.\n\nWhile 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.\n\nEvery segment that actually changes costs one of its 2 API edits. See [Edit limits](/guides/edit-limits). No credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_language": {
                    "type": "string",
                    "enum": [
                      "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"
                    ],
                    "description": "BCP 47 code of the language whose segments are corrected. A language the dub does not have returns 404."
                  },
                  "segments": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Segment id from GET /api/v1/dubs/{id}/segments. An unknown or deleted id returns 400."
                        },
                        "source_text": {
                          "type": "string",
                          "description": "Corrected source text. v1: re-translated and re-voiced in target_language right away, unless target_text is sent too. v2: applied at the next update."
                        },
                        "target_text": {
                          "type": "string",
                          "description": "Corrected translation. v1: voiced at the next update; an empty string mutes the segment. v2: applied at the next update."
                        },
                        "speaker": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Speaker id from speakers of GET /api/v1/dubs/{id}/segments; voiced at the next update. Engine v1 only (supportsVoiceSwap) — 400 on v2."
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    "description": "1–500 entries { id, source_text?, target_text?, speaker? }; each id at most once. Fields left out stay as they are. Split larger corrections into several requests."
                  },
                  "also_retranslate_languages": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "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"
                      ]
                    },
                    "description": "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."
                  }
                },
                "required": [
                  "target_language",
                  "segments"
                ],
                "additionalProperties": false
              },
              "examples": {
                "v1": {
                  "summary": "Engine v1: correct a source line, a translation and a speaker",
                  "value": {
                    "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"
                    ]
                  }
                },
                "v2": {
                  "summary": "Engine v2: correct texts, applied at the next update",
                  "value": {
                    "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!"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What happened to each entry, in the order of the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "segments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "result": {
                                "type": "string",
                                "enum": [
                                  "updated",
                                  "unchanged",
                                  "failed"
                                ],
                                "description": "\"updated\", \"unchanged\" (all values already as stored: nothing written, nothing counted) or \"failed\" (nothing saved, not counted)."
                              },
                              "api_edits_remaining": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991,
                                "description": "API edits left for this segment after this request (at most 2)."
                              },
                              "error": {
                                "type": "string",
                                "description": "On \"failed\": why nothing was saved. On \"updated\": the text was saved, but the re-translation failed or did not start."
                              }
                            },
                            "required": [
                              "id",
                              "result",
                              "api_edits_remaining"
                            ]
                          }
                        },
                        "retranslated_languages": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "v1: the languages of also_retranslate_languages the changed source texts were re-translated into. Always empty on v2."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "segments",
                        "retranslated_languages"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "v1": {
                    "summary": "Engine v1: one segment changed and re-translated into \"fr\"",
                    "value": {
                      "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"
                        ]
                      }
                    }
                  },
                  "v2": {
                    "summary": "Engine v2: both corrections saved as pending changes",
                    "value": {
                      "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": "updated",
                            "api_edits_remaining": 1
                          }
                        ],
                        "retranslated_languages": []
                      }
                    }
                  },
                  "partial": {
                    "summary": "Engine v1: a saved source text whose re-translation failed, and a failed entry",
                    "value": {
                      "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,
                            "error": "The source text was saved, but re-translating it failed: Failed to sync the segment. Please try again."
                          },
                          {
                            "id": "c9e0d2f1-47ab-4c3e-8f21-6a5b4d3c2e10",
                            "result": "failed",
                            "api_edits_remaining": 2,
                            "error": "Unexpected error while saving this segment."
                          }
                        ],
                        "retranslated_languages": []
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID, the body is invalid (an unknown field, no segments or more than 500, a segment id twice), the dub has not finished processing (status \"Dubbed\"), a segment id is unknown or deleted, a field is one the dub's engine does not allow (v2: speaker, also_retranslate_languages), a speaker is unknown, or also_retranslate_languages names target_language or a language the dub does not have. The message names the segment; nothing is written.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — A segment that would change — in target_language or in also_retranslate_languages — has used all its 2 API edits. Nothing was changed, nothing was counted; these segments can still be edited in the Dubly web app. Example message: \"API edit limit reached: a segment can be edited at most 2 times through the API. Exhausted: 5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54 (\"de\"). Nothing was changed — these segments can still be edited in the Dubly web app.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — 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. Nothing was changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub, its segments or its API usage could not be read, or the API edit limit could not be checked (nothing was changed), or every changed segment failed to save — no API edit was counted. A failed save can still have written part of a segment; check them with GET /api/v1/dubs/{id}/segments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/segments/timeline": {
      "post": {
        "operationId": "save-dub-timeline",
        "tags": [
          "Dub editing"
        ],
        "summary": "Save timeline edits of one language",
        "description": "One save of the web app's visual (timeline) editor for one target language of a completed dub: move segments, shorten or lengthen them, change their speech rate, text or speaker, split them, create new ones and delete them — with the editor's own save logic and limits. Engine v1 only (capability supportsTimelineEditor): on any other engine the request returns 400 — correct texts there with PATCH /api/v1/dubs/{id}/segments. All times are in seconds.\n\nEvery entry of updated carries the segment's complete new state; an entry whose values are all as stored is reported as \"unchanged\" and is neither written nor counted. The changes reach the video with the next POST /api/v1/dubs/{id}/update, which re-voices every segment whose duration, text or speaker changed (pending_revoice in GET /api/v1/dubs/{id}/segments); an empty target_text mutes a segment. A changed source_text sent with the stored (or an empty) target_text clears the translation: the segment is translated from the new source line; sent with a new target_text, that translation is kept.\n\ncreated adds segments, and the answer (200) maps each client_id to the new segment id. A split is the original segment in updated, shortened to its left half (with source_rebase when its source line is divided as well), plus its right half in created with split_from set to the original's id; a split_from that is not in updated of the same request returns 400. deleted removes segments: the freed time stays a gap, and GET /api/v1/dubs/{id}/segments no longer lists them.\n\nresync_retranslations: true re-translates and re-voices every segment whose source_text changed right away and voices every created segment that has a target_text (resynced_segment_ids); without it nothing is voiced before the next update.\n\nEverything is checked before anything is written: a speech_rate outside 0.7–1.3, a duration under 0.8 s (a segment that is already shorter may keep its length), an unknown speaker, an invalid field, an id twice or in updated and deleted, or more than 500 entries return 400; a segment id that does not belong to this dub and target_language, or is deleted, returns 404. While a review is in progress, an update or a lip sync is running for this language, or a changed segment is being re-translated or re-voiced, the request returns 409. Nothing is written in any of these cases.\n\nEvery segment in updated that actually changes costs one of its 2 API edits — the same counter as PATCH /api/v1/dubs/{id}/segments and POST …/regenerate. A new segment starts with 1 edit used, both halves of a split continue with the original's count + 1, and deleting costs nothing. If even one segment would go over the limit, the request returns 403 FORBIDDEN and nothing is written. A save that fails with an internal error while writing can already have written part of the changes, so its edits stay counted — check GET /api/v1/dubs/{id}/segments before you send it again. See [Edit limits](/guides/edit-limits). No credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_language": {
                    "type": "string",
                    "enum": [
                      "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"
                    ],
                    "description": "BCP 47 code of the language whose timeline is saved. A language the dub does not have returns 404."
                  },
                  "created": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "client_id": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Your own id for the entry, unique in this request. The answer maps it to the new segment id."
                        },
                        "split_from": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Only for the right half of a split: the id of the original segment, which must be in updated of this request with its shortened left half (otherwise 400). The half starts with the original's API edits used. That includes this save: both halves continue with the original's count + 1."
                        },
                        "start_time": {
                          "type": "number",
                          "minimum": 0,
                          "description": "Start in seconds (≥ 0)."
                        },
                        "duration": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "description": "Length in seconds, at least 0.8 s."
                        },
                        "speech_rate": {
                          "type": "number",
                          "minimum": 0.7,
                          "maximum": 1.3,
                          "description": "Speech rate from 0.7 to 1.3 (1 = normal)."
                        },
                        "target_text": {
                          "type": "string",
                          "description": "Translation of the new segment, voiced as it stands. An empty string: translated from source_text first, or silent without one."
                        },
                        "source_text": {
                          "default": "",
                          "type": "string",
                          "description": "Source line of the new segment — for the right half of a split, the part of the original line it keeps. Defaults to an empty string (no source line)."
                        },
                        "speaker": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991,
                          "description": "Speaker id from speakers of GET /api/v1/dubs/{id}/segments (\"1\", \"2\", …); an unknown id returns 400. Sent as a number (1) or as that string (\"1\")."
                        }
                      },
                      "required": [
                        "client_id",
                        "start_time",
                        "duration",
                        "speech_rate",
                        "target_text",
                        "speaker"
                      ],
                      "additionalProperties": false
                    },
                    "description": "New segments { client_id, split_from?, start_time, duration, speech_rate, target_text, source_text?, speaker } with the same field rules as updated. A created segment with a target_text is voiced as it stands; with only a source_text it is translated first; with neither it stays silent."
                  },
                  "updated": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Segment id from GET /api/v1/dubs/{id}/segments. An id of another dub or language, or a deleted one, returns 404."
                        },
                        "start_time": {
                          "type": "number",
                          "minimum": 0,
                          "description": "Start in seconds (≥ 0), like start in GET /api/v1/dubs/{id}/segments."
                        },
                        "duration": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "description": "Length in seconds (end − start in GET /api/v1/dubs/{id}/segments), at least 0.8 s — a segment that is already shorter may keep its length, but not get any shorter."
                        },
                        "speech_rate": {
                          "type": "number",
                          "minimum": 0.7,
                          "maximum": 1.3,
                          "description": "Speech rate from 0.7 to 1.3 (1 = normal)."
                        },
                        "target_text": {
                          "type": "string",
                          "description": "Translation. An empty string mutes the segment — unless source_text changes in the same entry: then the segment is translated from the new source line."
                        },
                        "source_text": {
                          "type": "string",
                          "description": "Rewritten source text; left out, the source stays as it is. With the stored or an empty target_text the segment is translated from it (at the next update, or right away with resync_retranslations)."
                        },
                        "source_rebase": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string",
                              "description": "The part of the original source line this half keeps."
                            },
                            "start_time": {
                              "type": "number",
                              "minimum": 0,
                              "description": "Start of this half inside the original segment, in seconds (≥ 0)."
                            },
                            "duration": {
                              "type": "number",
                              "exclusiveMinimum": 0,
                              "description": "Length of this half's share of the original source line, in seconds."
                            }
                          },
                          "required": [
                            "text",
                            "start_time",
                            "duration"
                          ],
                          "additionalProperties": false,
                          "description": "The left half of a split only: { text, start_time, duration } — the part of the original source line this half keeps, with its start inside the original segment and its length in seconds. Gives the half a source line of its own; nothing is re-translated."
                        },
                        "speaker": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991,
                          "description": "Speaker id from speakers of GET /api/v1/dubs/{id}/segments (\"1\", \"2\", …); an unknown id returns 400. Sent as a number (1) or as that string (\"1\")."
                        }
                      },
                      "required": [
                        "id",
                        "start_time",
                        "duration",
                        "speech_rate",
                        "target_text",
                        "speaker"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Existing segments with their complete new state { id, start_time, duration, speech_rate, target_text, source_text?, source_rebase?, speaker }; each id at most once. Segments left out stay as they are. At least one of created, updated and deleted must have an entry, and together they carry at most 500 entries."
                  },
                  "deleted": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "description": "Ids of segments to delete. The freed time stays a gap. Deleting costs no API edit."
                  },
                  "resync_retranslations": {
                    "type": "boolean",
                    "description": "true: re-translate and re-voice every segment whose source_text changed right away, and voice every created segment with a target_text right away. If starting one of them fails, the save still stands: resync_error says so and the rest are voiced by the next update. Defaults to false — nothing is voiced before POST /api/v1/dubs/{id}/update."
                  }
                },
                "required": [
                  "target_language"
                ],
                "additionalProperties": false
              },
              "examples": {
                "split": {
                  "summary": "Split a segment and delete another",
                  "value": {
                    "target_language": "de",
                    "updated": [
                      {
                        "id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                        "start_time": 0.48,
                        "duration": 1.32,
                        "speech_rate": 1,
                        "target_text": "Willkommen zu unserer",
                        "source_rebase": {
                          "text": "Welcome to our",
                          "start_time": 0,
                          "duration": 1.32
                        },
                        "speaker": 1
                      }
                    ],
                    "created": [
                      {
                        "client_id": "split-right",
                        "split_from": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                        "start_time": 1.8,
                        "duration": 1.32,
                        "speech_rate": 1,
                        "target_text": "Produkttour.",
                        "source_text": "product tour.",
                        "speaker": 1
                      }
                    ],
                    "deleted": [
                      "c9e0d2f1-47ab-4c3e-8f21-6a5b4d3c2e10"
                    ],
                    "resync_retranslations": false
                  }
                },
                "resync": {
                  "summary": "Rewrite a source line, add a segment and voice both right away",
                  "value": {
                    "target_language": "de",
                    "updated": [
                      {
                        "id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                        "start_time": 0.48,
                        "duration": 2.64,
                        "speech_rate": 1,
                        "target_text": "",
                        "source_text": "Welcome to our product demo.",
                        "speaker": 1
                      }
                    ],
                    "created": [
                      {
                        "client_id": "new-1",
                        "start_time": 3.5,
                        "duration": 1.6,
                        "speech_rate": 1.1,
                        "target_text": "Viel Spaß!",
                        "speaker": 2
                      }
                    ],
                    "resync_retranslations": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The save went through; created maps each client_id to its new segment id.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "created": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "client_id": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string",
                                "description": "The new segment id — use it like any id from GET /api/v1/dubs/{id}/segments."
                              },
                              "split_from": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The segment this one was split from (split_from of the request), else null."
                              },
                              "api_edits_remaining": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991,
                                "description": "API edits left for the new segment (at most 2)."
                              }
                            },
                            "required": [
                              "client_id",
                              "id",
                              "split_from",
                              "api_edits_remaining"
                            ]
                          }
                        },
                        "updated": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "result": {
                                "type": "string",
                                "enum": [
                                  "updated",
                                  "unchanged"
                                ],
                                "description": "\"updated\", or \"unchanged\": every field already had the stored value — neither written nor counted."
                              },
                              "api_edits_remaining": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991,
                                "description": "API edits left for this segment after this save (at most 2)."
                              }
                            },
                            "required": [
                              "id",
                              "result",
                              "api_edits_remaining"
                            ]
                          }
                        },
                        "deleted": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The deleted segment ids."
                        },
                        "resynced_segment_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "resync_retranslations: true only — the segments whose translation and voice-over were started right away; otherwise empty."
                        },
                        "resync_error": {
                          "type": "string",
                          "description": "resync_retranslations: true only — the save went through, but starting the immediate re-voicing failed; the remaining segments are voiced by the next POST /api/v1/dubs/{id}/update."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "created",
                        "updated",
                        "deleted",
                        "resynced_segment_ids"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "split": {
                    "summary": "Split and delete saved",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "created": [
                          {
                            "client_id": "split-right",
                            "id": "7a3c9e1b-5d2f-4b8a-9c6e-1f0d3b5a7c92",
                            "split_from": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                            "api_edits_remaining": 1
                          }
                        ],
                        "updated": [
                          {
                            "id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                            "result": "updated",
                            "api_edits_remaining": 1
                          }
                        ],
                        "deleted": [
                          "c9e0d2f1-47ab-4c3e-8f21-6a5b4d3c2e10"
                        ],
                        "resynced_segment_ids": []
                      }
                    }
                  },
                  "resync": {
                    "summary": "Saved; the re-translation started, voicing the new segment did not",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "created": [
                          {
                            "client_id": "new-1",
                            "id": "e4f8a2c6-1b3d-4e5f-9a7b-8c0d2e4f6a18",
                            "split_from": null,
                            "api_edits_remaining": 1
                          }
                        ],
                        "updated": [
                          {
                            "id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                            "result": "updated",
                            "api_edits_remaining": 1
                          }
                        ],
                        "deleted": [],
                        "resynced_segment_ids": [
                          "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54"
                        ],
                        "resync_error": "The edits were saved, but re-voicing segment e4f8a2c6-1b3d-4e5f-9a7b-8c0d2e4f6a18 right away failed: Failed to sync the segment. Please try again. The remaining segments are voiced by POST /api/v1/dubs/{id}/update."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID; the dub has not finished processing (status \"Dubbed\") or its engine has no timeline editing (supportsTimelineEditor); or a field is invalid — a speech_rate outside 0.7–1.3, a duration under 0.8 s (a segment that is already shorter may keep its length), an unknown speaker, an unknown field, an id twice or in updated and deleted, a client_id twice, a split_from that is not in updated, no entry at all or more than 500 entries. Nothing was written. Example message: \"created[0].split_from: segment 5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54 must also be in updated of this request (with its shortened left half)\".",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — A segment in updated that changes has used all its 2 API edits (shared with PATCH /api/v1/dubs/{id}/segments and POST …/regenerate). Nothing was written, nothing was counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account or a target_language the dub does not have, or a segment id in updated or deleted that does not belong to this dub and target_language, or is deleted. Nothing was written.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — A review is in progress, an update or a lip sync is running for this language, or a changed segment is being re-translated or re-voiced. Nothing was written.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub, its segments or its API usage could not be read, or the API edit limit could not be checked — nothing was written. Or the save failed while writing: part of it may already be written, so its API edits stay counted — check the segments with GET /api/v1/dubs/{id}/segments before you retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/segments/{segmentId}/regenerate": {
      "post": {
        "operationId": "regenerate-dub-segment",
        "tags": [
          "Dub editing"
        ],
        "summary": "Re-voice one segment",
        "description": "Re-voices one segment of a completed dub right away with its stored state — \"Regenerate\" in the web app's visual editor. The stored translation is spoken again (mode \"revoice\"). If the translation was cleared because POST /api/v1/dubs/{id}/segments/timeline changed the source text, the segment is first translated from the new source line and then voiced (mode \"retranslate\"); a muted segment stays silent.\n\nThe run is asynchronous: the answer is 202, and GET /api/v1/dubs/{id}/segments shows processing true for the segment until its new voice-over is in place. Engine v1 only (capabilities supportsTimelineEditor and supportsPerSegmentRegenerate): on any other engine the request returns 400.\n\nA segmentId that does not belong to this dub and target_language, or is deleted, returns 404. While the segment is already being re-translated or re-voiced, a review is in progress, or an update or a lip sync is running for this language, the request returns 409 and starts nothing.\n\nEvery accepted regenerate costs one of the segment's 2 API edits — the same counter as PATCH /api/v1/dubs/{id}/segments and POST …/segments/timeline; once they are used up, the next regenerate returns 403 FORBIDDEN and starts nothing — the segment can still be regenerated in the Dubly web app. A regenerate refused with 400, 403, 404 or 409, or one that fails to start with 500, is not counted. See [Edit limits](/guides/edit-limits). No credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "description": "Segment id from GET /api/v1/dubs/{id}/segments (path parameter). A segment of another dub or language, or a deleted one, returns 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_language": {
                    "type": "string",
                    "enum": [
                      "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"
                    ],
                    "description": "BCP 47 code of the language the segment belongs to. A language the dub does not have returns 404."
                  }
                },
                "required": [
                  "target_language"
                ],
                "additionalProperties": false
              },
              "examples": {
                "regenerate": {
                  "summary": "Re-voice a German segment",
                  "value": {
                    "target_language": "de"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Started: poll GET /api/v1/dubs/{id}/segments until processing is false for the segment.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "segment_id": {
                          "type": "string"
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "revoice",
                            "retranslate"
                          ],
                          "description": "\"revoice\": the stored translation is spoken again. \"retranslate\": the translation was cleared by a source edit — it is translated from the new source line, then voiced."
                        },
                        "api_edits_remaining": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "API edits left for this segment after this regenerate (at most 2)."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "segment_id",
                        "mode",
                        "api_edits_remaining"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "revoice": {
                    "summary": "Started: the stored translation is spoken again",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "segment_id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                        "mode": "revoice",
                        "api_edits_remaining": 1
                      }
                    }
                  },
                  "retranslate": {
                    "summary": "Started: translated from the new source line, then voiced",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "segment_id": "5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54",
                        "mode": "retranslate",
                        "api_edits_remaining": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID or segmentId is not a UUID, target_language is missing or no supported target language code, the dub has not finished processing (status \"Dubbed\"), or its engine cannot re-voice a single segment (supportsTimelineEditor, supportsPerSegmentRegenerate). Nothing was started, nothing was counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — The segment has used all its 2 API edits (shared with PATCH /api/v1/dubs/{id}/segments and POST …/segments/timeline). Nothing was started — the segment can still be regenerated in the Dubly web app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account or a target_language the dub does not have, or a segmentId that does not belong to this dub and target_language, or is deleted. Nothing was counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — The segment is already being re-translated or re-voiced, a review is in progress, an update or a lip sync is running for this language, or a voice of the dub is no longer available. Nothing was started, nothing was counted. Example message: \"Cannot regenerate right now: segment 5b1e7c2a-9d43-4f8e-a6b0-2c7d9e1f3a54 (\"de\") is being re-translated or re-voiced right now. Nothing was changed.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub or its segments could not be read, the API edit limit could not be checked, or the re-voicing failed to start. Nothing was counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/update": {
      "post": {
        "operationId": "start-dub-update",
        "tags": [
          "Dub editing"
        ],
        "summary": "Apply pending edits and re-render",
        "description": "Applies the pending edits of the given languages. Engine v1 runs the editor's \"Update\": re-voices every waiting segment, merges the audio and renders the video. Engine v2 runs \"Apply changes\", which also carries corrected source texts over to every other language of the dub that is not busy: those languages start as well, pass the same checks, cost one update round each and are listed in retranslated_languages.\n\nEach language is reported as \"started\", \"nothing_to_apply\" (no pending changes), \"already_running\" (v2: already being regenerated, e.g. through another language's source correction; its remaining changes stay pending), \"deferred\" (v1: the dub's voices are being restored for an earlier language; retry this one once that update has finished) or \"failed\" (with error). The response is 200 even when no language has anything to apply.\n\nAll languages are checked before the first one starts: while an update, a lip sync, a review or a single-segment re-voicing is running for any of them, the request returns 409 and nothing starts. If a language has a finished lip sync, the request returns 409 unless reset_lipsync is true, because the update replaces the audio the lip sync was made from.\n\nEvery language that actually starts costs one of its 2 API update rounds; nothing else counts. See [Edit limits](/guides/edit-limits). No credits are charged. Poll GET /api/v1/dubs/{id}/update for progress.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_languages": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "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"
                      ]
                    },
                    "description": "BCP 47 codes of the languages to update (at least one). A language the dub does not have returns 404."
                  },
                  "reset_lipsync": {
                    "type": "boolean",
                    "description": "Required as true when a language has a finished lip sync (otherwise 409). The lip sync of each language that starts is reset to \"NotStarted\", not restarted — start it again via POST /api/v1/dubs/{id}/lipsync once the update has finished. Defaults to false."
                  }
                },
                "required": [
                  "target_languages"
                ],
                "additionalProperties": false
              },
              "examples": {
                "update": {
                  "summary": "Update two languages, one with a finished lip sync",
                  "value": {
                    "target_languages": [
                      "de",
                      "fr"
                    ],
                    "reset_lipsync": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What happened to each requested language — 200 even when no language has anything to apply.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "reset_lipsync": {
                          "type": "boolean",
                          "description": "Whether reset_lipsync was sent as true."
                        },
                        "languages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "target_language": {
                                "type": "string"
                              },
                              "result": {
                                "type": "string",
                                "enum": [
                                  "started",
                                  "nothing_to_apply",
                                  "already_running",
                                  "deferred",
                                  "failed"
                                ],
                                "description": "\"started\", \"nothing_to_apply\" (no pending changes), \"already_running\" (v2: already being regenerated; its remaining changes stay pending), \"deferred\" (v1: retry once the update of an earlier language has finished) or \"failed\" (with error)."
                              },
                              "api_update_rounds_remaining": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991,
                                "description": "API update rounds left for this language after this request (at most 2)."
                              },
                              "error": {
                                "type": "string",
                                "description": "Why the language did not start although it had changes, or what of it stays pending."
                              }
                            },
                            "required": [
                              "target_language",
                              "result",
                              "api_update_rounds_remaining"
                            ]
                          }
                        },
                        "retranslated_languages": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "v2: further languages of the dub this request started because a corrected source text is carried over to every language — each costs one of its API update rounds like a requested one. Always empty on v1."
                        }
                      },
                      "required": [
                        "dub_id",
                        "reset_lipsync",
                        "languages",
                        "retranslated_languages"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "v1": {
                    "summary": "Engine v1: one language started, one had nothing to apply",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "reset_lipsync": true,
                        "languages": [
                          {
                            "target_language": "de",
                            "result": "started",
                            "api_update_rounds_remaining": 1
                          },
                          {
                            "target_language": "fr",
                            "result": "nothing_to_apply",
                            "api_update_rounds_remaining": 2
                          }
                        ],
                        "retranslated_languages": []
                      }
                    }
                  },
                  "v2": {
                    "summary": "Engine v2: a source correction of \"de\" carried over to the other languages",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "reset_lipsync": false,
                        "languages": [
                          {
                            "target_language": "de",
                            "result": "started",
                            "api_update_rounds_remaining": 1
                          },
                          {
                            "target_language": "fr",
                            "result": "started",
                            "api_update_rounds_remaining": 1,
                            "error": "Regenerated with the corrected source text of \"de\". This language's own changes were not part of that and stay pending — send POST /api/v1/dubs/{id}/update for it again once it has finished."
                          }
                        ],
                        "retranslated_languages": [
                          "es"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID, the body is invalid (no target_languages, a code that is no supported target language, an unknown field), or the dub has not finished processing (status \"Dubbed\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — A language that would start — requested, or reached by a v2 source correction — has used all its 2 API update rounds. Nothing was started, nothing was counted; these languages can still be updated in the Dubly web app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a language in target_languages the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — An update, a lip sync, a review or a single-segment re-voicing is running for one of the languages (v2: also for a language the corrected source text would be carried over to), or a language has a finished lip sync and reset_lipsync is not true. Nothing was started. Example message: \"The lip sync of \"de\" is finished, and an update replaces the audio it was made from. Send \"reset_lipsync\": true to reset it — it is not restarted automatically. Nothing was started.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub or its API usage could not be read, the API update limit could not be checked, or no language with changes could be started — nothing was started and no API update round was counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get-dub-update",
        "tags": [
          "Dub editing"
        ],
        "summary": "Get the render state of one language",
        "description": "Returns the render state of one language — the same fields as the language level of GET /api/v1/dubs/{id}/segments: pending_changes (edits that POST /api/v1/dubs/{id}/update would apply; v1: segments waiting for an update, v2: changes waiting for \"Apply changes\"), is_updating, update_status (\"idle\", or the running phase voice_cloning → speech_syncing → merging → rendering; \"error\" if the last update failed), lipsync_status, api_update_rounds_remaining and video_url. video_url is null while an update is running and otherwise a signed URL of the current video, valid for 7 days, like GET /api/v1/dubs/{id}. Read-only: nothing is counted.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          {
            "name": "target_language",
            "in": "query",
            "required": true,
            "description": "BCP 47 target language code of the language to read (query parameter, e.g. ?target_language=de). A language the dub does not have returns 404.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "de"
          }
        ],
        "responses": {
          "200": {
            "description": "The render state of the language.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "engine": {
                          "type": "string",
                          "enum": [
                            "v1",
                            "v2"
                          ],
                          "description": "The engine of the dub. It decides which edits are available (capabilities in GET /api/v1/dubs/{id}/segments)."
                        },
                        "pending_changes": {
                          "type": "boolean",
                          "description": "Edits that POST /api/v1/dubs/{id}/update would apply; v1: segments waiting for an update, v2: changes waiting for \"Apply changes\"."
                        },
                        "is_updating": {
                          "type": "boolean",
                          "description": "An update of this language is running."
                        },
                        "update_status": {
                          "type": "string",
                          "enum": [
                            "idle",
                            "voice_cloning",
                            "speech_syncing",
                            "merging",
                            "rendering",
                            "error"
                          ],
                          "description": "\"idle\", or the running phase voice_cloning → speech_syncing → merging → rendering; \"error\" if the last update failed."
                        },
                        "lipsync_status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Lip-sync status of this language: \"not_started\", \"face_setup\", \"segmenting\", \"processing\", \"reconstructing\", \"done\", \"failed\", or null."
                        },
                        "api_update_rounds_remaining": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "API update rounds left for this language (at most 2)."
                        },
                        "video_url": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Signed URL of the current video, valid for 7 days, like GET /api/v1/dubs/{id}; null while an update is running."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "engine",
                        "pending_changes",
                        "is_updating",
                        "update_status",
                        "lipsync_status",
                        "api_update_rounds_remaining",
                        "video_url"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "running": {
                    "summary": "Update running (no URL until the new render is ready)",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "engine": "v1",
                        "pending_changes": true,
                        "is_updating": true,
                        "update_status": "merging",
                        "lipsync_status": "not_started",
                        "api_update_rounds_remaining": 1,
                        "video_url": null
                      }
                    }
                  },
                  "finished": {
                    "summary": "Update finished",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "engine": "v1",
                        "pending_changes": false,
                        "is_updating": false,
                        "update_status": "idle",
                        "lipsync_status": "not_started",
                        "api_update_rounds_remaining": 1,
                        "video_url": "https://...amazonaws.com/.../final_video.mp4?X-Amz-Expires=604800&..."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID, target_language is missing or no supported target language code, or the dub has not finished processing (status \"Dubbed\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub or its API usage could not be read. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/lipsync": {
      "post": {
        "operationId": "start-lipsync",
        "tags": [
          "Lip sync"
        ],
        "summary": "Start lip-sync for a subdub",
        "description": "Starts the lip-sync pipeline for one target language of a dub. The dub must already be fully processed (status \"Dubbed\") — this includes waiting for a re-render after an editor update (status \"Updating\"). Credits are charged at 1 credit per minute of video, rounded up (at least 1 credit). The job runs asynchronously — poll GET /api/v1/dubs/{id}/lipsync to retrieve the final URL once the status is \"Synced\".\n\nA language whose lip sync has finished (\"Synced\") can be started again. The new run is charged again, and before it starts, the previous lip-synced video of that language and its lip-sync blocks — including blocks switched with PATCH /api/v1/dubs/{id}/lipsync/segments — are deleted; until the new run is \"Synced\", the language has no lip-synced video.\n\nA language whose lip sync is already running or whose last run failed, and a language whose audio for lip sync is not available yet, return 409; without enough credits the request returns 403. A start refused with 400, 403, 404 or 409 charges nothing. If the lip-sync pipeline cannot be started once the credits are charged, the request returns 500, the credits stay charged and the lip sync of the language is marked as failed (\"Error\"), so every further start returns 409. There is no API limit on lip-sync runs — every run is paid in credits.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID returned by the create endpoint (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400. An unknown dub and a dub of another account return 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_language": {
                    "type": "string",
                    "enum": [
                      "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"
                    ],
                    "description": "BCP 47 target language code of the subdub to lip-sync (must match one of the target_languages used when creating the dub; another language returns 404). A code the dub's engine does not offer (— in that engine's column of [Supported target languages](/guides/supported-languages)) is rejected with 400, and so is a missing or unsupported code."
                  }
                },
                "required": [
                  "target_language"
                ]
              },
              "examples": {
                "german": {
                  "summary": "Lip-sync the German subdub",
                  "value": {
                    "target_language": "de"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The lip-sync run was started; poll GET /api/v1/dubs/{id}/lipsync for its progress.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "Processing",
                          "description": "Always \"Processing\" — the run has started."
                        },
                        "step": {
                          "type": "string",
                          "const": "face_setup",
                          "description": "The first pipeline step."
                        }
                      },
                      "required": [
                        "status",
                        "step"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "started": {
                    "summary": "Run started",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Processing",
                        "step": "face_setup"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID; the body is not valid JSON, or target_language is missing or not a supported target language code; the dub's engine does not offer target_language (— in that engine's column of [Supported target languages](/guides/supported-languages)); the dub is not fully processed (any status but \"Dubbed\", including \"Updating\"); or the dub is a subtitle order (lip sync is not available for subtitle orders). Nothing is charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — The account does not have enough credits for the run (1 credit per minute of video, rounded up). Nothing is started or charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — A lip sync is already running for this language; the last lip sync of this language failed (it can only be restarted via support); or the audio lip sync reads is not available for this language yet (e.g. while the audio split of an engine v2 dub is still running). Nothing is charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub could not be read, the run could not be prepared or the credits could not be charged — then nothing is started or charged. Or the lip-sync pipeline could not be started after the credits were charged — then the credits stay charged, the lip sync of the language reports \"Error\" and every further start returns 409 (it can only be restarted via support); on a restart of a \"Synced\" language, its previous lip-synced video is already deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get-lipsync",
        "tags": [
          "Lip sync"
        ],
        "summary": "Get lip-sync status and result URL",
        "description": "Check the current status of a lip-sync job. Returns \"NotStarted\" if lip-sync has never been triggered, \"Processing\" with the current pipeline step while running (step is one of \"face_setup\", \"segmenting\", \"processing\", \"reconstructing\"), \"Synced\" with the final video URL when complete, or \"Error\" if the job failed. An editor update of the dub resets a finished lip sync to \"NotStarted\". The URL is signed and valid for 7 days; call this endpoint again for a fresh one. The dub ID is passed as a path parameter and the target language as a query parameter.\n\nWorks for a dub in any status. Read-only: nothing is counted, no credits are charged and there is no limit.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). An unknown dub, a dub of another account and a deleted dub return 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          {
            "name": "target_language",
            "in": "query",
            "required": true,
            "description": "BCP 47 target language code of the subdub to query (query parameter, e.g. ?target_language=de). A missing or unsupported code returns 400, a language the dub does not have 404.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "de"
          }
        ],
        "responses": {
          "200": {
            "description": "The lip-sync state of the language.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "NotStarted",
                              "description": "\"NotStarted\", \"Processing\", \"Synced\" or \"Error\"."
                            }
                          },
                          "required": [
                            "status"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "Processing",
                              "description": "\"NotStarted\", \"Processing\", \"Synced\" or \"Error\"."
                            },
                            "step": {
                              "type": "string",
                              "enum": [
                                "face_setup",
                                "segmenting",
                                "processing",
                                "reconstructing"
                              ],
                              "description": "Only while \"Processing\": the current pipeline step, one of \"face_setup\", \"segmenting\", \"processing\", \"reconstructing\"."
                            }
                          },
                          "required": [
                            "status",
                            "step"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "Synced",
                              "description": "\"NotStarted\", \"Processing\", \"Synced\" or \"Error\"."
                            },
                            "url": {
                              "type": "string",
                              "description": "Only when \"Synced\": signed URL of the lip-synced video, valid for 7 days."
                            },
                            "credits_used": {
                              "type": "number",
                              "description": "Only when \"Synced\": the credits the run cost — only populated once the pipeline finishes."
                            }
                          },
                          "required": [
                            "status",
                            "url",
                            "credits_used"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "Error",
                              "description": "\"NotStarted\", \"Processing\", \"Synced\" or \"Error\"."
                            }
                          },
                          "required": [
                            "status"
                          ]
                        }
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "notStarted": {
                    "summary": "Never started",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "NotStarted"
                      }
                    }
                  },
                  "processing": {
                    "summary": "Processing",
                    "description": "step is one of: \"face_setup\", \"segmenting\", \"processing\", \"reconstructing\".",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Processing",
                        "step": "processing"
                      }
                    }
                  },
                  "synced": {
                    "summary": "Completed",
                    "description": "credits_used is only populated once the pipeline finishes.",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Synced",
                        "url": "https://...amazonaws.com/.../lipsync/final_video.mp4?X-Amz-Expires=604800&...",
                        "credits_used": 3
                      }
                    }
                  },
                  "failed": {
                    "summary": "Failed",
                    "value": {
                      "status": "success",
                      "response": {
                        "status": "Error"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID, or target_language is missing or not a supported target language code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The lip-sync state could not be read. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/lipsync/segments": {
      "get": {
        "operationId": "get-lipsync-segments",
        "tags": [
          "Lip sync"
        ],
        "summary": "List the lip-sync blocks of one language",
        "description": "Returns the lip-sync blocks of one target language of a completed dub — the lip-sync track of the web app's visual editor — in track order, each with its id (what PATCH /api/v1/dubs/{id}/lipsync/segments takes), start and end in seconds and enabled (true: the block shows the lip-synced video; false: it shows the original video). On the language level it returns api_lipsync_applies_remaining, the API lip-sync applies this language has left.\n\nThe blocks exist only for a finished lip sync: while the lip sync of the language is not \"done\" — never started, running, being re-assembled (\"reconstructing\") or failed — the request returns 409. Engine v1 only (capability supportsTimelineEditor): on any other engine the request returns 400. A dub that has not finished processing returns 400; an unknown dub, a dub of another account and a target_language the dub does not have return 404.\n\nRead-only: nothing is counted, no credits are charged and there is no limit.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          {
            "name": "target_language",
            "in": "query",
            "required": true,
            "description": "BCP 47 target language code of the language to read (query parameter, e.g. ?target_language=de). A language the dub does not have returns 404.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "de"
          }
        ],
        "responses": {
          "200": {
            "description": "The lip-sync blocks of the language, in track order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "segments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Block id — what PATCH /api/v1/dubs/{id}/lipsync/segments takes."
                              },
                              "start": {
                                "type": "number",
                                "description": "Start of the block in seconds."
                              },
                              "end": {
                                "type": "number",
                                "description": "End of the block in seconds."
                              },
                              "enabled": {
                                "type": "boolean",
                                "description": "true: the block shows the lip-synced video; false: it shows the original video."
                              }
                            },
                            "required": [
                              "id",
                              "start",
                              "end",
                              "enabled"
                            ]
                          },
                          "description": "The lip-sync blocks, in track order."
                        },
                        "api_lipsync_applies_remaining": {
                          "type": "number",
                          "description": "The API lip-sync applies this language has left (at most 2)."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "segments",
                        "api_lipsync_applies_remaining"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "blocks": {
                    "summary": "Two blocks, lip sync applied to the first",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "segments": [
                          {
                            "id": "8d2f4b6a-1c3e-4a5b-9d7f-0e2a4c6b8d1f",
                            "start": 0,
                            "end": 4.2,
                            "enabled": true
                          },
                          {
                            "id": "f1e3c5a7-9b2d-4f6e-8a0c-2d4f6b8a0c3e",
                            "start": 4.2,
                            "end": 9.64,
                            "enabled": false
                          }
                        ],
                        "api_lipsync_applies_remaining": 2
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID; target_language is missing or not a supported target language code; the dub has not finished processing; or the dub's engine has no timeline editing (capability supportsTimelineEditor — engine v1 only).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — The lip sync of the language is not \"done\" — never started, running, being re-assembled (\"reconstructing\") or failed. Example message: `The lip sync of \"de\" is not finished (lipsync_status \"processing\") — its blocks exist only once it is \"done\"`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub, its blocks or the API usage could not be read. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch-lipsync-segments",
        "tags": [
          "Lip sync"
        ],
        "summary": "Switch lip sync on or off per block",
        "description": "Switches lip sync on or off for blocks of one target language and re-assembles the finished lip-sync video from the segments it already has — the visual editor's \"Re-render\" when only the lip-sync track changed. There is no POST /api/v1/dubs/{id}/update, no new lip-sync run and no credits. Send the blocks to change, each id at most once.\n\nThe re-assembly runs asynchronously: the answer is 202 with lipsync_status \"reconstructing\"; poll GET /api/v1/dubs/{id}/lipsync, which answers \"Processing\" with step \"reconstructing\" until it is \"Synced\" again. If every block already has the requested value, the answer is 200 with applied false: nothing is re-assembled and nothing is counted.\n\nAn empty blocks array or a duplicate id returns 400, and so does a dub whose engine has no supportsTimelineEditor (v2). A block id that belongs to another language or another dub returns 404 — once the language's lip sync is finished; before that, every request returns 409. While the lip sync of the language is running or not finished, an update is running, a review is in progress, or the block files have already been cleaned up (then only a new lip sync via POST /api/v1/dubs/{id}/lipsync can change the blocks), the request returns 409; so does a block whose lip sync is no longer stored and can only come back with a new run. Nothing is changed in any of these cases.\n\nEvery re-assembly that actually starts costs one of the language's 2 API lip-sync applies — a counter of its own, separate from the segment edits; once they are used up, the next change returns 403 FORBIDDEN and changes nothing — the blocks can still be switched in the Dubly web app. A request refused with 400, 403, 404 or 409, or one whose re-assembly fails to start with 500, is not counted. See [Edit limits](/guides/edit-limits).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_language": {
                    "type": "string",
                    "enum": [
                      "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"
                    ],
                    "description": "BCP 47 code of the language whose lip-sync blocks are switched. A language the dub does not have returns 404."
                  },
                  "blocks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Block id from GET /api/v1/dubs/{id}/lipsync/segments. A block of another language or dub returns 404; a value that is not a UUID returns 400."
                        },
                        "enabled": {
                          "type": "boolean",
                          "description": "true: apply lip sync to this block; false: show the original video there."
                        }
                      },
                      "required": [
                        "id",
                        "enabled"
                      ],
                      "additionalProperties": false
                    },
                    "description": "At least one entry { id, enabled }; each id at most once (otherwise 400). Blocks left out stay as they are."
                  }
                },
                "required": [
                  "target_language",
                  "blocks"
                ],
                "additionalProperties": false
              },
              "examples": {
                "switch": {
                  "summary": "Switch two blocks",
                  "value": {
                    "target_language": "de",
                    "blocks": [
                      {
                        "id": "8d2f4b6a-1c3e-4a5b-9d7f-0e2a4c6b8d1f",
                        "enabled": false
                      },
                      {
                        "id": "f1e3c5a7-9b2d-4f6e-8a0c-2d4f6b8a0c3e",
                        "enabled": true
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every block already as requested: nothing re-assembled, nothing counted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "applied": {
                          "type": "boolean",
                          "description": "true: the lip-sync video is being re-assembled. false: every block already had the requested value — nothing was re-assembled or counted."
                        },
                        "changed_segment_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The blocks whose value changed; empty when applied is false."
                        },
                        "lipsync_status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "\"reconstructing\" while the video is re-assembled — poll GET /api/v1/dubs/{id}/lipsync; \"done\" when nothing changed."
                        },
                        "api_lipsync_applies_remaining": {
                          "type": "number",
                          "description": "The API lip-sync applies this language has left (at most 2)."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "applied",
                        "changed_segment_ids",
                        "lipsync_status",
                        "api_lipsync_applies_remaining"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "unchanged": {
                    "summary": "Nothing to change",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "applied": false,
                        "changed_segment_ids": [],
                        "lipsync_status": "done",
                        "api_lipsync_applies_remaining": 2
                      }
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Re-assembly started: poll GET /api/v1/dubs/{id}/lipsync until it is \"Synced\" again. Counted as one API lip-sync apply.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "applied": {
                          "type": "boolean",
                          "description": "true: the lip-sync video is being re-assembled. false: every block already had the requested value — nothing was re-assembled or counted."
                        },
                        "changed_segment_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The blocks whose value changed; empty when applied is false."
                        },
                        "lipsync_status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "\"reconstructing\" while the video is re-assembled — poll GET /api/v1/dubs/{id}/lipsync; \"done\" when nothing changed."
                        },
                        "api_lipsync_applies_remaining": {
                          "type": "number",
                          "description": "The API lip-sync applies this language has left (at most 2)."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "applied",
                        "changed_segment_ids",
                        "lipsync_status",
                        "api_lipsync_applies_remaining"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "reassembling": {
                    "summary": "Re-assembly started",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "applied": true,
                        "changed_segment_ids": [
                          "8d2f4b6a-1c3e-4a5b-9d7f-0e2a4c6b8d1f",
                          "f1e3c5a7-9b2d-4f6e-8a0c-2d4f6b8a0c3e"
                        ],
                        "lipsync_status": "reconstructing",
                        "api_lipsync_applies_remaining": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID; the body is not valid JSON or has an unknown field; target_language is missing or not a supported target language code; blocks is empty or has a duplicate id or an id that is not a UUID; the dub has not finished processing; or the dub's engine has no timeline editing (capability supportsTimelineEditor, e.g. v2). Nothing is changed or counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — The language has used all of its 2 API lip-sync applies. Nothing was changed, nothing was counted — the blocks can still be switched in the Dubly web app. Example message: `API lip-sync limit reached: the lip-sync blocks of a language can be applied at most 2 times through the API. Exhausted: \"de\". Nothing was changed — the blocks can still be changed in the Dubly web app.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, a target_language the dub does not have, or — once the language's lip sync is finished — a block id of another language or dub. Nothing is changed or counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — The lip sync of the language is running or not finished, an update is running, a review is in progress, the block files have been cleaned up (only a new lip sync via POST /api/v1/dubs/{id}/lipsync can change the blocks), or a block's lip sync is no longer stored and can only come back with a new run. Nothing is changed or counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub, its blocks or the API lip-sync limit could not be read (nothing is changed), or the re-assembly failed to start. Not counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dubs/{id}/subtitled-video": {
      "post": {
        "operationId": "start-subtitled-video",
        "tags": [
          "Subtitled video"
        ],
        "summary": "Burn subtitles into the video of one language",
        "description": "Starts burning subtitles into the video of one target language of a completed dub — the same burn-in as on the dub page of the web app. The base is the lip-sync video when the lip sync of this language is finished (\"Synced\"), otherwise the final dubbed video. The run is asynchronous: the answer's status is \"aligning\" (the words are timed first) or \"rendering\". Poll GET /api/v1/dubs/{id}/subtitled-video until it is \"ready\", then download the file there or via GET /api/v1/dubs/{id}/downloads. A language whose burn-in is \"ready\" or \"failed\" can be started again; that is a new run.\n\nA dub that has not finished processing, a language without a base video, an unknown style and an invalid accent_color return 400. While a burn-in is already running for this language (\"aligning\" or \"rendering\") or a review of the language is in progress, the request returns 409 and starts nothing.\n\nEvery run that actually starts costs one of the language's 2 API burn-ins; once they are used up, the next start returns 403 FORBIDDEN, starts nothing and leaves the status as it is — burning in subtitles is still possible in the Dubly web app. A start refused with 400, 403, 404 or 409, or one that fails with 500, is not counted. See [Edit limits](/guides/edit-limits). No credits are charged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). The dub must have finished processing (status \"Dubbed\"); otherwise the request returns 400.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_language": {
                    "type": "string",
                    "enum": [
                      "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"
                    ],
                    "description": "BCP 47 code of the language whose video gets the subtitles. A language the dub does not have returns 404."
                  },
                  "style": {
                    "type": "string",
                    "enum": [
                      "business",
                      "social"
                    ],
                    "description": "Subtitle style, one of \"business\", \"social\". Any other value returns 400."
                  },
                  "accent_color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Highlight colour as #RRGGBB for a style with an accent colour: \"social\" (default #FFE53D). Left out or null, the style's default colour is used. Any other format returns 400. Ignored for a style without an accent colour."
                  }
                },
                "required": [
                  "target_language",
                  "style"
                ],
                "additionalProperties": false
              },
              "examples": {
                "accent": {
                  "summary": "Style with a custom accent colour",
                  "value": {
                    "target_language": "de",
                    "style": "social",
                    "accent_color": "#47CD89"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The burn-in was started and cost one of the language's 2 API burn-ins.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "aligning",
                            "rendering"
                          ],
                          "description": "\"aligning\" (the words are timed first) or \"rendering\"."
                        },
                        "style": {
                          "type": "string",
                          "enum": [
                            "business",
                            "social"
                          ],
                          "description": "The style of this run."
                        },
                        "accent_color": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The applied highlight colour; null for a style without an accent colour or when its default colour is used."
                        },
                        "api_runs_remaining": {
                          "type": "number",
                          "description": "The API burn-ins this language has left (at most 2)."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "status",
                        "style",
                        "accent_color",
                        "api_runs_remaining"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "started": {
                    "summary": "Burn-in started",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "status": "aligning",
                        "style": "social",
                        "accent_color": "#47CD89",
                        "api_runs_remaining": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID; the body is not valid JSON or has an unknown field; target_language is missing or not a supported target language code; an unknown style or an invalid accent_color; the dub has not finished processing; or the language has no base video. Nothing is started or counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN — The language has used all of its 2 API burn-ins. Nothing is started or counted and the status stays as it is — subtitles can still be burned in through the Dubly web app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT — A burn-in is already running for this language (\"aligning\" or \"rendering\"), or a review of the language is in progress. Nothing is started or counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub could not be read, the API burn-in limit could not be checked, or the burn-in failed to start. No API run is counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get-subtitled-video",
        "tags": [
          "Subtitled video"
        ],
        "summary": "Get the burn-in state of one language",
        "description": "Returns the burn-in state of one target language: status (null = never started, \"aligning\", \"rendering\", \"ready\" or \"failed\"), style and accent_color of the last run (accent_color is null for a style without an accent colour or when its default colour is used), error (only when \"failed\": what went wrong) and api_runs_remaining. Only when \"ready\" does the answer add download_url, download_file_name and download_expires_at, built like the \"subtitled-video\" entry of GET /api/v1/dubs/{id}/downloads: a signed URL valid until download_expires_at (1 hour after the request), or download_url null with download_error \"video_corrupted\" when the file fails the integrity check.\n\nWorks for a dub in any status. An unknown dub, a dub of another account and a target_language the dub does not have return 404. Read-only: nothing is counted, no credits are charged and there is no limit.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dub ID (path parameter). An unknown dub, a dub of another account and a deleted dub return 404.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          {
            "name": "target_language",
            "in": "query",
            "required": true,
            "description": "BCP 47 target language code of the language to read (query parameter, e.g. ?target_language=de). A language the dub does not have returns 404.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "de"
          }
        ],
        "responses": {
          "200": {
            "description": "The burn-in state of the language.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "dub_id": {
                          "type": "string"
                        },
                        "target_language": {
                          "type": "string"
                        },
                        "status": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "aligning",
                                "rendering",
                                "ready",
                                "failed"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "null = never started, \"aligning\", \"rendering\", \"ready\" or \"failed\"."
                        },
                        "style": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "business",
                                "social"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Style of the last run; null when never started."
                        },
                        "accent_color": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Highlight colour of the last run; null for a style without an accent colour or when its default colour is used."
                        },
                        "error": {
                          "type": "string",
                          "description": "Only when \"failed\": what went wrong."
                        },
                        "download_url": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Only when \"ready\": signed URL of the file, valid until download_expires_at (1 hour); null when the file fails the integrity check."
                        },
                        "download_file_name": {
                          "type": "string",
                          "description": "Only when \"ready\": file name of the download."
                        },
                        "download_expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Only when \"ready\": when download_url expires (ISO 8601); null together with download_url."
                        },
                        "download_error": {
                          "type": "string",
                          "const": "video_corrupted",
                          "description": "Only when the file fails the integrity check: \"video_corrupted\"."
                        },
                        "api_runs_remaining": {
                          "type": "number",
                          "description": "The API burn-ins this language has left (at most 2)."
                        }
                      },
                      "required": [
                        "dub_id",
                        "target_language",
                        "status",
                        "style",
                        "accent_color",
                        "api_runs_remaining"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "ready": {
                    "summary": "Ready",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "status": "ready",
                        "style": "social",
                        "accent_color": "#47CD89",
                        "download_url": "https://...amazonaws.com/.../subtitled_video.mp4?X-Amz-Signature=...",
                        "download_file_name": "My_Video_de_subtitled_video.mp4",
                        "download_expires_at": "2026-11-24T13:00:00.000Z",
                        "api_runs_remaining": 1
                      }
                    }
                  },
                  "corrupted": {
                    "summary": "Ready, but the file failed the integrity check",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "status": "ready",
                        "style": "business",
                        "accent_color": null,
                        "download_url": null,
                        "download_file_name": "My_Video_de_subtitled_video.mp4",
                        "download_expires_at": null,
                        "download_error": "video_corrupted",
                        "api_runs_remaining": 1
                      }
                    }
                  },
                  "failed": {
                    "summary": "Failed",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "status": "failed",
                        "style": "business",
                        "accent_color": null,
                        "error": "Rendering the subtitled video failed. Please try again.",
                        "api_runs_remaining": 1
                      }
                    }
                  },
                  "neverStarted": {
                    "summary": "Never started",
                    "value": {
                      "status": "success",
                      "response": {
                        "dub_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "target_language": "de",
                        "status": null,
                        "style": null,
                        "accent_color": null,
                        "api_runs_remaining": 2
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST — The dub ID is not a UUID, or target_language is missing or not a supported target language code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND — An unknown dub, a dub of another account, or a target_language the dub does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The dub or its API usage could not be read, or the download link could not be created. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects": {
      "get": {
        "operationId": "list-projects",
        "tags": [
          "Account"
        ],
        "summary": "List your projects",
        "description": "Returns all projects owned by your account, newest first. Use the returned project IDs as project_id when creating a dub.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The projects of your account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Pass it as project_id when creating a dub or moving one (PATCH /api/v1/dubs/{id})."
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "color": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Hex colour of the project in the web app, or null."
                              },
                              "tag": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Short label of the project, or null."
                              },
                              "created_at": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "color",
                              "tag",
                              "created_at"
                            ]
                          }
                        }
                      },
                      "required": [
                        "projects"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "projects": {
                    "summary": "One project",
                    "value": {
                      "status": "success",
                      "response": {
                        "projects": [
                          {
                            "id": "83724e4d-f41a-4f1a-a4c3-590e6b296bb0",
                            "name": "Marketing Campaigns",
                            "description": "All marketing-related dubs",
                            "color": "#3b82f6",
                            "tag": "marketing",
                            "created_at": "2026-03-15T10:00:00Z"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The projects could not be read. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/custom-voices": {
      "get": {
        "operationId": "list-custom-voices",
        "tags": [
          "Account"
        ],
        "summary": "List your custom voices",
        "description": "Returns all custom voices configured for your account, newest first. Use the returned id as custom_voice_id when creating a dub.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The custom voices of your account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "success"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "custom_voices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Pass it as custom_voice_id when creating a dub."
                              },
                              "name": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "created_at"
                            ]
                          }
                        }
                      },
                      "required": [
                        "custom_voices"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "response"
                  ]
                },
                "examples": {
                  "voices": {
                    "summary": "One custom voice",
                    "value": {
                      "status": "success",
                      "response": {
                        "custom_voices": [
                          {
                            "id": "1fd47408-c5ff-4de0-97b1-f37c7372710e",
                            "name": "Company Speaker",
                            "created_at": "2026-03-20T14:30:00Z"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHORIZED — Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR — The custom voices could not be read. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API token from Settings → API in the Dubly web app, sent as `Authorization: Bearer <token>`."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "error"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "message"
        ],
        "description": "The error envelope. The HTTP status carries the error code; `message` says what went wrong, in English.",
        "examples": [
          {
            "status": "error",
            "message": "Dub not found"
          }
        ]
      }
    }
  }
}
