Generate Video from Template
Changed onGenerates a video from a template by filling its variables. Use scene_ids to select, reorder or repeat the template's existing scenes. Poll GET /v3/videos/{video_id} or use webhooks for completion. An idempotent replay returns the original response, not the video's current state.
Request
- Base URLhttps://api.heygen.com
- URLhttps://api.heygen.com/v3/templates/{template_id}
- Auth
- API key in header x-api-key
- or HTTP bearer
Path parameters
Unique template identifier
Headers
Optional client-supplied key for safely retrying mutations. Subsequent calls within 24 hours that share this key replay the original response — even if the request body differs slightly (a warning is logged). A retry that arrives while the original is still in flight gets a 409 request_in_progress. Keys must be 1–255 characters from [A-Za-z0-9_:.-]; a UUID is a safe default. Scope is per-endpoint and per-resource: the same key on a different route or path parameter is independent.
Request body
Response
Successful response
Example response
{
"data": {
"id": "v_abc123def456",
"title": "My Generated Video",
"created_at": 1711929600,
"completed_at": 1711930200,
"video_url": "https://files.heygen.ai/video/abc123.mp4",
"thumbnail_url": "https://files.heygen.ai/thumb/abc123.jpg",
"gif_url": "https://files.heygen.ai/gif/abc123.gif",
"captioned_video_url": "https://files.heygen.ai/video/abc123_captioned.mp4",
"subtitle_url": "https://files.heygen.ai/srt/abc123.srt",
"duration": 30.5,
"folder_id": "folder_abc123",
"output_language": "en-US",
"failure_code": "rendering_failed",
"failure_message": "Avatar rendering timed out",
"video_page_url": "https://app.heygen.com/video/abc123"
}
}Changes
- breaking
removed the enum value
avatarof the request property/// - breaking
removed the enum value
talking_photoof the request property/// - info
added the new optional request property
- info
added the new optional request property
/// - info
added the new optional request property
/// - info
the request property
///became optional - info
the
request property default valueavatarwas removed - info
request property
deprecated - info
request property
///deprecated - info
request property
///deprecated - info
added
asset_idbase64urldiscriminator mapping keys to the///request property - info
added
asset_idbase64urldiscriminator mapping keys to the///request property - info
added
asset_idbase64urldiscriminator mapping keys to the///request property - info
added
audiocharacterimagetextvideovoicediscriminator mapping keys to the/request property - info
request property
///list-of-types was widened by adding typesnullto media typeapplication/json - info
request property
///list-of-types was widened by adding typesnullto media typeapplication/json - info
the
///request property's minLength was decreased from1to0 - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status
- breaking