> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dubly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Apply pending edits and re-render

> 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.

Each 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.

All 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.

Every 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.



## OpenAPI

````yaml /openapi.json post /api/v1/dubs/{id}/update
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/{id}/update:
    post:
      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.


        Each 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.


        All 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.


        Every 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.
      operationId: start-dub-update
      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'
      security:
        - bearerAuth: []
components:
  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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API token from Settings → API in the Dubly web app, sent as
        `Authorization: Bearer <token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.