Documentation Index
Fetch the complete documentation index at: https://developers.heygen.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
A Digital Twin
avatar_id (type: digital_twin). Use GET /v3/avatars/looks?avatar_type=digital_twin to find yours.A
voice_id for the voice you want. Use GET /v3/voices to browse available voices.Step 1 — Find your Digital Twin
List your private Digital Twin looks to get theavatar_id:
id field of the look you want. This is your avatar_id.
Step 2 — Choose a rendering engine
HeyGen v3 supports two rendering engines for Digital Twins. You select the engine via theengine object in your video creation request.
| Engine | Key | Default? | Quality |
|---|---|---|---|
| Avatar IV | avatar_iv | Yes — used when engine is omitted | Standard, widely supported |
| Avatar V | avatar_v | No — must be explicitly requested | Higher quality, cross-reference-driven animation |
Before requesting Avatar V, check the
supported_api_engines array on the avatar look via GET /v3/avatars/looks/{look_id}. If "avatar_v" is not listed, the request will be rejected. See Avatar Models for full details.Step 3 — Create the video
Send aPOST request to /v3/videos with type: "avatar", your Digital Twin ID, a script, and a voice.
Using Avatar IV (default)
Omit theengine field or pass {"type": "avatar_iv"} — Avatar IV is the default:
Using Avatar V (higher quality)
Pass{"type": "avatar_v"} in the engine field to request cross-reference-driven animation:
Step 4 — Poll for completion
Video generation is asynchronous. PollGET /v3/videos/{video_id} until status is completed:
Status values
| Status | Meaning |
|---|---|
pending | Queued for processing |
processing | Video is being generated |
completed | Ready — video_url is available |
failed | Something went wrong — check failure_message |
video_url with a presigned download link.
Full example
Optional parameters
| Parameter | Type | Engine | Description |
|---|---|---|---|
title | string | Both | Display name in the HeyGen dashboard |
resolution | string | Both | 4k, 1080p, or 720p |
aspect_ratio | string | Both | 16:9 or 9:16 |
engine | object | — | {"type": "avatar_iv"} or {"type": "avatar_v"}. Defaults to Avatar IV when omitted |
remove_background | boolean | Both | Removes the avatar background (twin must be trained with matting enabled) |
background | object | Both | Set a solid color or image background |
voice_settings | object | Both | Adjust speed (0.5–1.5), pitch (-50 to +50), and locale |
motion_prompt | string | IV only | Natural-language prompt controlling avatar body motion |
expressiveness | string | IV only | high, medium, or low. Defaults to low |
output_format | string | Both | mp4 (default) or webm (transparent background / alpha channel) |
callback_url | string | Both | Webhook URL — receive a POST when the video is ready |
Using webhooks instead of polling
Instead of polling, pass acallback_url when creating the video. HeyGen will send a POST request to that URL when the video completes or fails.
Register a webhook endpoint via
POST /v3/webhooks/endpoints and subscribe to avatar_video.success and avatar_video.fail events for production use.
