Generate Video from Template
Generates 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/ or use webhooks for completion. An idempotent replay returns the original response, not the video’s current state.
Authorizations
HeyGen API key. Obtain from your HeyGen dashboard.
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.
1 - 255^[A-Za-z0-9_\-:.]{1,255}$Path Parameters
Unique template identifier
Body
Request body for POST /v3/templates/{template_id}.
Template variable replacements, keyed by the variable name defined in the template. Supply every text variable you want filled: an omitted text variable is not substituted, so its literal {{variable_name}} placeholder remains in the text it is bound to, whether that is a spoken script or an on-screen text element. Omitting an image, video, audio, character or voice variable is safe and keeps the value the template already holds. The defaults returned by GET /v3/templates/{template_id} are the template's current values, not fallbacks applied at generation time.
Title for the generated video
Whether to burn captions into the video
Subtitle style settings. Implies captions when provided.
Opaque ID echoed back in webhook events for this video
URL called with the video result in addition to registered webhook endpoints
Destination folder ID in the caller's workspace, for example one returned by POST /v3/folders. Omit, pass null, or pass an empty string to place the result at the workspace root. The id must name a folder that is not in the trash and that the caller can write to. Assets library folders are accepted, but the HeyGen app files only assets in them, so a result placed there may not appear in the Assets library view. An unknown id, a folder in another workspace, a project of another kind such as a brand kit, or a trashed folder is rejected with 404 before anything is created. Supported only for single-video creation; batch video items cannot set their own destination folder.
Legacy field name for brand_glossary_id. Both are accepted and resolve to the same workspace record. Prefer brand_glossary_id.
Brand glossary controlling how custom terms are pronounced in generated speech. Discover IDs via GET /v3/brand-glossaries.
Output resolution override. Must match the template's aspect ratio.
Output frame rate. One of 25, 30, or 60.
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.
When true (default), background audio tracks move with their scenes. When false, tracks stay pinned to layout positions.
When true, replaced text elements are vertically re-centered based on their rendered height
Whether to include a GIF preview in the webhook payload
Whether the generated video's share page is publicly accessible
Response
Successful response
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.

