edit dialogue and preview the result as audio
Applies word-level edits to a transcript from POST /v2/transcriptions and synthesizes preview audio for the same window: only the edited spans are re-spoken in a voice cloned from the source, everything else stays the original recording. Poll GET /v2/dialogue-edits/{id} until status is COMPLETED, COMPLETED_PARTIAL or FAILED; a completed or partially completed job carries previewAudioUrl, the retimed resultTranscript and the edited regions as resultSlots. Edits that cannot be applied return 400 PLAN_FAILED. Requests with more than 100 edits return 400 dialogue_edit_too_many_edits. API-key requests must cover the whole video: omit startMs and endMs. A partial window returns 422 dialogue_edit_unsupported. A source longer than the 10-minute dialogue limit returns 422 SOURCE_TOO_LONG.
Send Idempotency-Key on the first request and reuse it with the same body on retries. A replay returns 200 with the original job’s current state and Idempotency-Replayed: true. Reusing a key with different inputs returns 409 IDEMPOTENCY_KEY_CONFLICT. A malformed key returns 400 INVALID_IDEMPOTENCY_KEY. If the job cannot be queued, retry the 503 with the same key and body. Honor Retry-After when present.
Autenticación
Encabezados
Case-sensitive organization-scoped key. Send one header with 1–128 characters from [A-Za-z0-9._~-]+. Reuse the same key and body for retries; use a new key for a new or revised edit.
Solicitud
The transcript the edits refer to, as returned by GET /v2/transcriptions/{id}. Edits name words by their id in this transcript. Word timings are in milliseconds from the start of the source video.
The edits to apply: change replaces one word (wordId, replacement, and an optional pronunciation), remove cuts a contiguous run of words (wordIds). Between 1 and 100 edits per job. More than 100 returns 400 with errorCode dialogue_edit_too_many_edits.
URL of the source video the transcript was made from, hosted in sync. storage (upload it via POST /v2/assets/upload first).
Start of the edited window, in milliseconds from the start of the source. Use the same window the transcript was made for. Defaults to 0. An API-key request must leave startMs and endMs unset; the edit then covers the whole video.
End of the edited window, in milliseconds from the start of the source. Omit to run to the end. The window cannot exceed 10 minutes. An API-key request must leave startMs and endMs unset to edit the whole video. With endMs omitted, a transcript that runs more than 10 minutes past startMs returns 422 with errorCode SOURCE_TOO_LONG.
Opaque voice id returned as voiceId by an earlier dialogue-edit job of the same source. Reusing it skips cloning the voice again. Omit on the first job for a source. Ids your organization has not used before are ignored.
Id of the completed dialogue-edit job this request revises, when regenerating a preview after adjusting the edits. Informational lineage only; unknown ids are ignored.
The completed transcription job this edit is based on. Send it so the edit and the transcript agree on the source: the request is refused when that job’s source, window or words do not match this edit.
Respuesta
A new job returns 201. An equivalent keyed replay returns 200 with this response shape and Idempotency-Replayed true.
Job id. Poll GET /v2/dialogue-edits/{id} with it.
Job status. COMPLETED, COMPLETED_PARTIAL and FAILED are terminal. COMPLETED_PARTIAL means the preview is playable but shipped without something that was requested; treat it as completed.
Whether the preview was cut for per-region lipsync (true) or for re-lipsyncing the whole window (false). Decided when the job is created and fixed for its lifetime. True for new jobs.
Whether the preview was made under the section-expansion policy. Decided when the job is created and fixed for its lifetime. True for new jobs.
Hosted WAV of the edited audio for the whole window: the original recording with only the edited spans re-synthesized. Null until the job completes.
Asset id of the registered preview after completion, when available. Null or absent before completion or for an unregistered preview. To lipsync the edit, pass the job id as dialogueEdit: { id } on POST /v2/generate.
The edited regions in order, each located on the preview timeline (outputStartMs, outputDurationMs) and in the source video (sourceStartMs, sourceDurationMs). Everything between two slots is untouched source. Null until the job completes.
Opaque id of the voice cloned from the source and used for synthesis. Pass it as voiceId on the next dialogue-edit job of the same source to skip cloning. Null until the voice exists.
What a completed preview shipped without: edited regions that may sound rough, or a background that could not be kept. The preview is playable either way. Null or absent when nothing was missed, and until the job completes.

