Create/update HeyGen API account

July 4, 2025 (August 21, 2025)

HeyGen API has been decommissioned. Currently we do not have plans to re-release it and recommend switching to Mureka API for speech and music generation.

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

This endpoint adds or updates a HeyGen account in your configuration. The API will automatically login to verify your credentials.

https://api.useapi.net/v1/heygen/accounts

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
  "email": "[email protected]",
  "password": "your-password",
  "maxJobs": 10
}
  • email and password are required.
    Please see Setup HeyGen for details.

  • maxJobs is required, specify maximum number of concurrent jobs (1-10)

Responses
  • 201 Created

    {
      "email": "[email protected]",
      "session": {
        "heygen_session": "…secured…",
        "ExpireTime": 1720123456789,
        "ExpireTimeUTC": "2024-07-04T12:30:45.789Z",
        "access_token": "…secured…",
        "session_token": "…secured…",
        "space_id": "space_abc123",
        "token": "…secured…",
        "username": "[email protected]",
        "ack_agreement": true,
        "internal": false,
        "need_mfa": false
      },
      "maxJobs": 10,
      "password": "…secured…"
    }
    
  • 400 Bad Request

    {
      "error": "Account does not exist or password is incorrect"
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 402 Payment Required

    {
      "error": "Subscription required",
      "code": 402
    }
    
Model
{ // TypeScript, all fields are optional
  email: string
  session: {
    heygen_session: string
    ExpireTime: number
    ExpireTimeUTC: string
    access_token: string
    session_token: string
    space_id: string
    token: string
    username: string
    ack_agreement: boolean
    internal: boolean
    need_mfa: boolean
  }
  maxJobs: number
  password: string
  error: string
}
Examples
  • curl -X POST https://api.useapi.net/v1/heygen/accounts \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer …" \
       -d '{"email": "[email protected]", "password": "your-password", "maxJobs": 10}'
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/heygen/accounts"; 
    const response = await fetch(apiUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${token}`,
      },
      body: JSON.stringify({
        email: "[email protected]",
        password: "your-password",
        maxJobs: 10
      })
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    apiUrl = "https://api.useapi.net/v1/heygen/accounts"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    data = {
        "email": "[email protected]",
        "password": "your-password",
        "maxJobs": 10
    }
    response = requests.post(apiUrl, headers=headers, json=data)
    print(response, response.json())
    
Try It