Skip to main content
POST
Generate Video from Template

Authorizations

x-api-key
string
header
required

HeyGen API key. Obtain from your HeyGen dashboard.

Headers

Idempotency-Key
string

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.

Required string length: 1 - 255
Pattern: ^[A-Za-z0-9_\-:.]{1,255}$

Path Parameters

template_id
string
required

Unique template identifier

Body

application/json

Request body for POST /v3/templates/{template_id}.

variables
Variables · object
required

Template variable replacements, keyed by the variable name defined in the template

title
string | null

Title for the generated video

caption
boolean
default:false

Whether to burn captions into the video

subtitles
TemplateSubtitleSettings · object | null

Subtitle style settings. Implies captions when provided.

callback_id
string | null

Opaque ID echoed back in webhook events for this video

callback_url
string | null

URL called with the video result in addition to registered webhook endpoints

folder_id
string | null

Folder to place the generated video in

brand_voice_id
string | null

Brand voice ID controlling pronunciation

dimension
TemplateVideoDimension · object | null

Output resolution override. Must match the template's aspect ratio.

fps
number
default:25

Output frame rate. One of 25, 30, or 60.

scene_ids
string[] | null

Scene IDs to render, in order (repeats allowed). Scenes must already exist in the template; the API can select, reorder, and repeat scenes but cannot create new ones. Omit to render all scenes in template order.

reorder_music
boolean
default:true

When true (default), background audio tracks move with their scenes. When false, tracks stay pinned to layout positions.

keep_text_vertically_centered
boolean
default:false

When true, replaced text elements are vertically re-centered based on their rendered height

include_gif
boolean
default:false

Whether to include a GIF preview in the webhook payload

enable_sharing
boolean
default:false

Whether the generated video's share page is publicly accessible

Response

Successful response

data
VideoDetail · object

Video resource returned by list and detail endpoints.

If output_language is present the video is a translated video; otherwise it is a generated video.