Skip to main content
API reference: Get Video Scenes · Get Video
POST /v3/videos/{video_id} edits a finished video in place. Name the scenes, script lines, and avatars to change by the ids GET /v3/videos/{video_id}/scenes returns, send only the fields that change, and HeyGen renders the same video_id again. Scenes you leave out keep their audio and avatar footage, so a one-line fix renders and bills one scene.

Before · a three-scene studio video from POST /v3/videos.

After · one edit call. Scene 1 has a new voice at 1.1× speed, scene 3 a new closing line. Scene 2 is the same footage.

Three calls

1

Read the scenes

GET /v3/videos/{video_id}/scenes on a completed video. It returns one edit_version for the video, and every scene, element, and script line with its id. See Video Scenes for the shape.
2

Send the edit

POST /v3/videos/{video_id} with the edit_version, the changes keyed by id, and a new UUID in the Idempotency-Key header. The response is 200 with status: "pending" and a version_id for the new render.
3

Poll the video

GET /v3/videos/{video_id} until status is completed, or pass callback_url and callback_id in the edit body to get a webhook. Read the scenes again for the next edit_version before your next edit.

Example

The request below produced the “after” video above: a new voice on scene 1 and new text on scene 3.
Response

What you can edit

Each line and element entry carries its id and its type, as the scenes read shows them. Omitted fields keep their value. To empty motion_prompt or expressiveness, name it in the entry’s clear list. One request edits up to 10 scenes, so an engine switch covers videos with up to 10 avatar scenes. Avatar style edits cover scenes with one avatar, in videos whose avatars are all photo avatars or all video avatars. Read-back fields outside the table, such as avatar_id, background, source, and actions, answer 400 edit_not_supported with param naming the field. Any other key answers 400 invalid_parameter.
An engine switch keeps each scene’s audio, so the video’s length stays the same. An edited scene renders as it would if you had created the video with those values through POST /v3/videos.

Retries and versions

Billing

An edit bills as an API render of the scenes it changes, at the rate of each scene’s engine. A scene drops out of the charge when every avatar in it is served from the avatar cache, which is typically the case for scenes you leave out. Scenes without an avatar bill on every render. For a three-scene video:

Errors

Errors use the v3 envelope: code, message, and param, which names the field by its position in your request, for example scenes.0.script.0.text.

Edit with an agent

Prompt for your agent