Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / HeyGen

HeyGen

AI avatar videos: browse avatar looks and voices, create videos and check their status.

6 actions API key 5 read1 write Calls api.heygen.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "heygen" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Create avatar videowriteheygen.create_videoCreate an avatar video from a script, avatar look id and voice id. Rendering is asynchronous and consumes credits; poll with get_video.
InputTypeDescription
avatar_idstringRequiredAvatar look id from list_avatar_looks
voice_idstringRequiredVoice id from list_voices
scriptstringRequiredWhat the avatar says
titlestringOptionalDisplay name in the HeyGen dashboard
resolutionstringOptionalOutput resolution
aspect_ratiostringOptionalAspect ratio
TypeScript
await setu.execute({
  userId: "user_1",
  action: "heygen.create_video",
  input: {
    "avatar_id": "<avatar_id>",
    "voice_id": "<voice_id>",
    "script": "<script>"
  },
});
Get current userreadheygen.get_current_userGet the account's profile, billing type and remaining credit balance for this API key.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "heygen.get_current_user",
  input: {},
});
Get video statusreadheygen.get_videoGet a video's status (pending, processing, completed, failed) and, when completed, its video URL and duration.
InputTypeDescription
video_idstringRequiredVideo id returned by create_video
TypeScript
await setu.execute({
  userId: "user_1",
  action: "heygen.get_video",
  input: {
    "video_id": "<video_id>"
  },
});
List avatar looksreadheygen.list_avatar_looksList avatar looks (outfits/styles). A look's id is the avatar_id to use when creating a video.
InputTypeDescription
group_idstringOptionalOnly looks of this avatar group
avatar_typestringOptionalAvatar type
ownershipstringOptionalpublic (HeyGen presets) or private (your own)
limitintegerOptionalResults per page, 1 to 50 (default 20)
tokenstringOptionalnext_token from a previous page
TypeScript
await setu.execute({
  userId: "user_1",
  action: "heygen.list_avatar_looks",
  input: {},
});
List avatar groupsreadheygen.list_avatarsList avatar groups (characters), each with the number of looks it has.
InputTypeDescription
ownershipstringOptionalpublic or private
limitintegerOptionalResults per page, 1 to 50 (default 20)
tokenstringOptionalnext_token from a previous page
TypeScript
await setu.execute({
  userId: "user_1",
  action: "heygen.list_avatars",
  input: {},
});
List voicesreadheygen.list_voicesList and filter voices by language and gender. A voice_id is used when creating a video.
InputTypeDescription
typestringOptionalpublic (shared library) or private (your clones)
languagestringOptionalLanguage, e.g. English
genderstringOptionalmale or female
limitintegerOptionalResults per page, 1 to 100 (default 20)
tokenstringOptionalnext_token from a previous page
TypeScript
await setu.execute({
  userId: "user_1",
  action: "heygen.list_voices",
  input: {},
});