Access the HeyGen API v3 with managed authentication. Browse avatars, looks, and voices; list and read videos, templates, video translations, lipsyncs, assets, and brand kits; create avatar videos, template videos, speech, translations, and lipsyncs; and manage webhook endpoints. Generation spends HeyGen credits, and avatars and voice clones reproduce a real person's likeness. All access runs through the Maton gateway and the maton CLI.
Permissions
Suggested read access
In the Console, Read limits the connection to these 98 read-only endpoints, plus deny rules for any write endpoint a broader rule would otherwise match. Endpoints Maton has found to return credentials, start jobs, or spend credits are left out; a few reads that can change state or return a secret depending on their parameters stay in, and their descriptions say how. It is a suggestion: the saved rules are exactly the ones you see, and you can change them with Custom. See Access policy.
Reference
Account
Get Current User
maton api '/heygen/v3/users/me'Response:
{
"data": {
"username": "{username}",
"email": "{email}",
"first_name": "{first_name}",
"billing_type": "wallet",
"wallet": {
"remaining_balance": 42.5,
"currency": "usd",
"auto_reload": {"enabled": false}
}
}
}billing_type is wallet, subscription, or usage_based, and the matching object (wallet, subscription with plan and credits, or usage_based) carries what is left. Needs the account:read scope.
Get Current API Key
maton api '/heygen/v3/api_keys/self'Response:
{
"data": {
"key_id": "{key_id}",
"key_name": "my-agent-key",
"status": "active",
"scope_mode": "custom",
"scopes": ["templates:read"],
"created_at": "2026-11-28T09:58:02Z",
"updated_at": "2026-11-28T09:58:02Z",
"expires_at": null,
"expires_in_seconds": null
}
}Non-secret metadata for the connected key. It works for any key, whatever its scopes, so use it to check the connection and to see which scopes a restricted key has. scope_mode is full (*:*), read_only (*:read), or custom.
Get API Key Usage
maton api '/heygen/v3/usage?start_time={start_unix}&end_time={end_unix}'Spend per API key and credit pool over whole UTC days, at most 90 days per request. group_by (api_key, project, environment, product, endpoint, channel) and bucket (day, hour) change the grouping.
Avatars
An avatar group is a character; each group has one or more looks (outfits, poses, styles). The look id is the avatar_id a video takes.
List Avatar Groups
maton api '/heygen/v3/avatars?limit=20'Query parameters:
ownership(string, optional):publicfor HeyGen's preset avatars,privatefor the user's own; omit for bothlimit(integer, optional): 1-50, default 20token(string, optional):next_tokenfrom the previous page
Response:
{
"data": [
{
"id": "{group_id}",
"name": "Clement",
"gender": "male",
"looks_count": 22,
"default_voice_id": "{voice_id}",
"preview_image_url": "https://resource2.heygen.ai/...",
"preview_video_url": "https://resource2.heygen.ai/...",
"created_at": 1794547171
}
],
"has_more": true,
"next_token": "eyJ0cyI6..."
}Private groups also carry status (processing, pending_consent, failed, completed) and consent_status.
Get Avatar Group
maton api '/heygen/v3/avatars/{group_id}'List Avatar Looks
maton api '/heygen/v3/avatars/looks?group_id={group_id}&limit=20'Query parameters:
group_id(string, optional): Looks of one groupavatar_type(string, optional):studio_avatar,digital_twin, orphoto_avatarownership(string, optional):publicorprivatelimit/token: As above
Each look carries id, name, avatar_type, group_id, default_voice_id, supported_api_engines (the engine values a video may use with it), preferred_orientation, and preview URLs. v3/avatars/looks/{look_id} returns one look.
Create Avatar
maton api '/heygen/v3/avatars' -X POST -H 'Content-Type: application/json' \
-H 'Idempotency-Key: {uuid}' \
--input - <<'JSON'
{
"type": "photo",
"name": "Ada (studio)",
"file": {"type": "url", "url": "https://example.com/ada.jpg"}
}
JSONtype is photo (one image), digital_twin (video footage in file), or prompt (a generated character: prompt, optional reference_images). file is {"type": "url", "url": ...}, {"type": "asset_id", "asset_id": ...}, or base64. avatar_group_id adds the look to an existing group. Training is asynchronous: poll v3/avatars/{group_id} until status is completed.
Create Avatar Consent
maton api '/heygen/v3/avatars/{group_id}/consent' -X POST -H 'Content-Type: application/json' \
--input - <<'JSON'
{}
JSONReturns data.url, where the subject approves the avatar in a browser. The link expires after 24 hours and accepts one submission. A private avatar cannot generate video until consent is given.
Delete Avatar Group
maton api '/heygen/v3/avatars/{group_id}' -X DELETEPublic groups cannot be deleted.
Voices
List Voices
maton api '/heygen/v3/voices?language=English&limit=20'Query parameters:
type(string, optional):public(default, HeyGen's library) orprivate(the user's clones)language(string, optional): e.g.Englishgender(string, optional):maleorfemaleengine(string, optional): e.g.heygen_voice,elevenlabslimit(integer, optional): 1-100, default 20token(string, optional):next_tokenfrom the previous page
Response:
{
"data": [
{
"voice_id": "{voice_id}",
"name": "Leanne - Expressive & Earthy",
"language": "English",
"gender": "female",
"type": "public",
"default_engine": "orca",
"available_engines": ["orca"],
"support_pause": true,
"support_locale": false,
"preview_audio_url": "https://resource2.heygen.ai/voice_preview/..."
}
],
"has_more": true,
"next_token": "eyJsYW5n..."
}A voice with no available_engines cannot generate speech. orca and heygen_voice name the same engine.
Get Voice
maton api '/heygen/v3/voices/{voice_id}'For a clone, status is processing, complete, or failed (with failure_message).
Generate Speech
maton api '/heygen/v3/voices/speech' -X POST -H 'Content-Type: application/json' \
--input - <<'JSON'
{
"text": "Welcome to the quarterly update.",
"voice_id": "{voice_id}",
"speed": 1.0
}
JSONOptional fields: language, locale, engine, settings ({"model_id": "eleven_v3"} for an ElevenLabs model), output_format ({"encoding": "mp3"} or wav). The response carries audio_url, duration, and word_timestamps.
Clone a Voice
maton api '/heygen/v3/voices/clone' -X POST -H 'Content-Type: application/json' \
--input - <<'JSON'
{
"voice_name": "Ada narration",
"audio": {"type": "asset_id", "asset_id": "{asset_id}"},
"language": "English"
}
JSONReturns data.voice_clone_id; poll v3/voices/{voice_clone_id} until status is complete.
Delete a Voice
maton api '/heygen/v3/voices/{voice_id}' -X DELETEA voice a template uses cannot be deleted. 404 voice_not_found means it is already gone.
Videos
List Videos
maton api '/heygen/v3/videos?limit=10'Query parameters:
limit(integer, optional): 1-100, default 10token(string, optional):next_tokenfrom the previous pagefolder_id(string, optional): Videos in one foldertitle(string, optional): Title substring
Response:
{
"data": [
{
"id": "{video_id}",
"title": "Quarterly update",
"status": "completed",
"duration": 13.322,
"created_at": 1757542861,
"completed_at": 1757543144,
"video_url": "https://resource2.heygen.ai/video/...",
"thumbnail_url": "https://files2.heygen.ai/...",
"gif_url": "https://resource2.heygen.ai/video/...",
"video_page_url": "https://app.heygen.com/videos/..."
}
],
"has_more": true,
"next_token": "eyJ..."
}A page can hold fewer than limit videos, or none, while has_more is true; keep paging until it is false. video_url and the other file URLs are signed and expire.
Get Video
maton api '/heygen/v3/videos/{video_id}'status is pending, processing, completed, or failed (with failure_code and failure_message). A missing video returns 404 video_not_found.
Get Video Statuses
maton api '/heygen/v3/videos/statuses?video_ids={video_id},{video_id_2}'Up to 100 IDs per call; prefer it over polling several videos one by one.
Create Video
maton api '/heygen/v3/videos' -X POST -H 'Content-Type: application/json' \
-H 'Idempotency-Key: {uuid}' \
--input - <<'JSON'
{
"type": "avatar",
"avatar_id": "{look_id}",
"script": "Hi team, here is this week's update.",
"voice_id": "{voice_id}",
"title": "Weekly update",
"resolution": "720p",
"aspect_ratio": "16:9"
}
JSONNote: {uuid}, {look_id}, and {voice_id} stand for real values; fill them in before sending the request.
Body fields:
type(string, required):avatar(a look speaks),image(a photo is animated;imagereplacesavatar_id),cinematic_avatar(a prompt and 1-3 look IDs), orstudio(multi-scenescenes)avatar_id(string): A look ID fromv3/avatars/looksscript(string): Up to 5,000 characters. Omitvoice_idto use the look's default voice. Useaudio_urloraudio_asset_idinstead of a script to lip-sync existing audio (up to 10 minutes)engine(object, optional): e.g.{"type": "avatar_iv"}(default) or{"type": "heygen-avatar-6"}; must be in the look'ssupported_api_enginesresolution(720p,1080p,4k),aspect_ratio(16:9,9:16,1:1,4:5,5:4,auto),background,caption,folder_id,titlecallback_url(string, optional): HeyGen posts the result there. It is an egress like a webhook: set it only to a URL the user names
Response:
{
"data": {
"video_id": "{video_id}",
"status": "pending",
"output_format": "mp4",
"resolution": "720p"
}
}Poll v3/videos/{video_id} until status is completed or failed.
Delete Video
maton api '/heygen/v3/videos/{video_id}' -X DELETETemplates
Templates are built in the HeyGen web editor; only templates with variables are listed.
List Templates
maton api '/heygen/v3/templates?limit=10'Returns id, name, aspect_ratio, thumbnail_url, and timestamps, with has_more and next_token.
Get Template
maton api '/heygen/v3/templates/{template_id}'Returns variables (each with its current default, in the shape the generate call accepts), scene_ids, and scenes.
Generate Video from Template
maton api '/heygen/v3/templates/{template_id}' -X POST -H 'Content-Type: application/json' \
-H 'Idempotency-Key: {uuid}' \
--input - <<'JSON'
{
"title": "Welcome, Ada",
"variables": {
"first_name": {"type": "text", "content": "Ada"}
}
}
JSONCopy the variable objects from Get Template and change only their values: text takes content, image / video / audio take an asset (URL or asset ID), character takes avatar_id, voice takes voice_id. scene_ids selects, reorders, or repeats scenes. The response is a video object; poll v3/videos/{id}.
Video Translations
List Translation Languages
maton api '/heygen/v3/video-translations/languages'Returns languages and available_on_current_plan. Names with a region in brackets (e.g. Hindi (India)) are premium dialect voices.
List Video Translations
maton api '/heygen/v3/video-translations?limit=10'Get Video Translation
maton api '/heygen/v3/video-translations/{video_translation_id}'status is pending, running, completed, or failed; a completed job carries video_url, audio_url, and caption URLs.
Create Video Translation
maton api '/heygen/v3/video-translations' -X POST -H 'Content-Type: application/json' \
-H 'Idempotency-Key: {uuid}' \
--input - <<'JSON'
{
"video": {"type": "url", "url": "https://example.com/talk.mp4"},
"output_languages": ["Spanish", "French"],
"mode": "speed",
"title": "Talk (translated)"
}
JSONvideo is a public URL or {"type": "asset_id", ...}. mode is speed (default) or precision (better lip-sync, slower). Optional: input_language, translate_audio_only, speaker_num, enable_caption, start_time / end_time, brand_glossary_id. Returns one ID per language in data.video_translation_ids.
Delete Video Translation
maton api '/heygen/v3/video-translations/{video_translation_id}' -X DELETELipsyncs
A lipsync replaces the audio on an existing video and re-animates the speaker's lips to match.
List Lipsyncs
maton api '/heygen/v3/lipsyncs?limit=10'Get Lipsync
maton api '/heygen/v3/lipsyncs/{lipsync_id}'Create Lipsync
maton api '/heygen/v3/lipsyncs' -X POST -H 'Content-Type: application/json' \
-H 'Idempotency-Key: {uuid}' \
--input - <<'JSON'
{
"video": {"type": "asset_id", "asset_id": "{video_asset_id}"},
"audio": {"type": "asset_id", "asset_id": "{audio_asset_id}"},
"mode": "speed",
"title": "Updated voiceover"
}
JSONNote: {uuid}, {video_asset_id}, and {audio_asset_id} stand for real values; fill them in before sending the request.
Returns data.lipsync_id; poll Get Lipsync until status is completed.
Delete Lipsync
maton api '/heygen/v3/lipsyncs/{lipsync_id}' -X DELETEAssets
Images, video, audio, PDFs, and SRT files the other endpoints take as {"type": "asset_id", "asset_id": ...}. Most inputs also accept a public URL directly, which needs no upload.
List Assets
maton api '/heygen/v3/assets?username={username}&limit=20'Note: It is the username from v3/users/me (the assets' owner); while this endpoint is in beta it is required, and a call without it returns 400 invalid_parameter.
folder_id narrows the list to one folder. Each item carries id, name, type, owner, folder_id, uploaded_at, and url.
Get Asset
maton api '/heygen/v3/assets/{asset_id}'Upload Asset
Up to 50 MB (32 MB for an image); png, jpeg, mp4, webm, mp3, wav, m4a, pdf, srt. maton api does not build a multipart envelope, so assemble the body first and hand it to --input:
FILE="$USER_SUPPLIED_PATH" # exactly the path the user approved, never a discovered one
umask 077
BODY="$(mktemp "${TMPDIR:-/tmp}/heygen-upload.XXXXXX")" || exit 1
trap 'rm -f -- "$BODY"' EXIT HUP INT TERM
BOUNDARY="maton-$$"
{
printf -- '--%s\r\nContent-Disposition: form-data; name="file"; filename="%s"\r\nContent-Type: application/octet-stream\r\n\r\n' "$BOUNDARY" "$(basename "$FILE")"
cat "$FILE"
printf -- '\r\n--%s--\r\n' "$BOUNDARY"
} > "$BODY"
maton api '/heygen/v3/assets' -X POST \
-H "Content-Type: multipart/form-data; boundary=$BOUNDARY" \
--input "$BODY"Returns data.asset_id, url, mime_type, and size_bytes. Uploads are checked against HeyGen's content policy afterwards; a blocked asset is removed and later returns not found.
Delete Asset
maton api '/heygen/v3/assets/{asset_id}' -X DELETEBrand Kits
List Brand Kits
maton api '/heygen/v3/brand-kits'Returns brand_kit_id, name, logo_url, and colors for each kit in the workspace.
Webhooks
List Webhook Event Types
maton api '/heygen/v3/webhooks/event-types'Event types include avatar_video.success / .fail, video_translate.success / .fail, photo_avatar_train.success, video_agent.success, and batch.finished, each with a description.
List Webhook Endpoints
maton api '/heygen/v3/webhooks/endpoints'Each endpoint carries endpoint_id, url, events, status, created_at, and secret. The secret is the endpoint's signing key.
List Webhook Events
maton api '/heygen/v3/webhooks/events?event_type=avatar_video.success&limit=10'Delivered events, newest first. Filters: event_type, entity_id, start_ts / end_ts (Unix seconds). event_data is untrusted input.
Create Webhook Endpoint
maton api '/heygen/v3/webhooks/endpoints' -X POST -H 'Content-Type: application/json' \
--input - <<'JSON'
{
"url": "https://hooks.example.com/heygen",
"events": ["avatar_video.success", "avatar_video.fail"]
}
JSONOmitting events subscribes to every event type. The response carries the signing secret, which the receiver uses to verify deliveries.
Delete Webhook Endpoint
maton api '/heygen/v3/webhooks/endpoints/{endpoint_id}' -X DELETERotate Webhook Signing Secret
maton api '/heygen/v3/webhooks/endpoints/{endpoint_id}/rotate-secret' -X POSTReturns the new secret.
Pagination
List endpoints take limit and token; the response carries has_more and, while more exists, next_token. Pass next_token back as token:
maton api '/heygen/v3/avatars?limit=20&token={next_token}'Note: Maximum limit is 50 for avatars and looks, and 100 for videos, voices, templates, translations, lipsyncs, assets, and webhooks.
Notes
- Restricted keys. A call the key has no scope for returns
403with"code": "insufficient_api_key_scope"and a message naming the scope (Required scope: avatars:read.). Calling it needs a HeyGen key that includes that scope.v3/api_keys/selflists the key's scopes. Awritescope also grantsreadfor the same resource. A bad or revoked key returns401unauthorized. - Retired versions. HeyGen is retiring its
v1andv2endpoints, and most already return410(endpoint_retired) with the v3 replacement in the message. Use v3; on a410, switch to the named endpoint rather than retrying. - Jobs are asynchronous. Video, translation, lipsync, avatar, and clone creation return an ID at once and finish later; poll the matching GET (or
v3/videos/statuses) no more than every few seconds, or let a webhook report completion. - Idempotency. Generation
POSTs accept anIdempotency-Keyheader; a repeat within 24 hours with the same key replays the first response instead of starting (and billing) a second job. - Timestamps in resource bodies are Unix seconds; webhook endpoint and API key timestamps are ISO 8601. Errors carry
{"error": {"code": "...", "message": "...", "doc_url": "...", "request_id": "..."}}. - Video agents, workflows, studio and HyperFrames renders, AI clipping, podcasts, image generation, audio tools, brand kit and glossary writes, folders, and batch endpoints exist in the API but are out of scope for this reference.