# Create Digital Twin

Submits the URLs for the required training footage and consent statement to create a Digital Twin. 

<Callout icon="📘" theme="info">
  **Note:**

  * Using a Digital Twin to generate video via API will consume 2x credits and is only available to <Anchor label="**Enterprise**" target="_blank" href="https://www.heygen.com/api-pricing">**Enterprise**</Anchor> API plan users.
  * Scroll down to the **Response** section below and expand the status code(s) to view the detailed response schema.
  * Refer to the **RESPONSE** section on the right and choose an example to see how the API response appears for each status code.
  * The consent video must follow specific guidelines including visible HeyGen branding. See [**Recording your Consent Video**](*https://help.heygen.com/en/articles/12092609-recording-your-consent-video)  for requirements.
</Callout>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "heygen-api",
    "version": "4.0.8"
  },
  "servers": [
    {
      "url": "https://api.heygen.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header",
        "x-default": "<your-api-key>"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v2/video_avatar": {
      "post": {
        "description": "",
        "operationId": "post_new-endpoint",
        "responses": {
          "200": {
            "description": "Digital Twin creation initiated successfully - Expand to view the detailed response schema.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Displays error message when the request fails; null if the request is successful."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "avatar_id": {
                          "type": "string",
                          "description": "Unique identifier of the avatar. "
                        },
                        "avatar_group_id": {
                          "type": "string",
                          "description": "Unique identifier of the avatar group. "
                        }
                      },
                      "description": "Contains the avatar details. "
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "summary": "Result",
                    "value": {
                      "error": null,
                      "data": {
                        "avatar_id": "22d490e6bc5f42c7b4c7b7dc60d2c6a0",
                        "avatar_group_id": "bc765f7072694649a7a95bd845c08de7"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "training_footage_url ": {
                    "type": "string",
                    "description": "Public URL to the training footage (.mp4, H.264 preferred, minimum 720p, and at least 30 seconds in duration). Google Drive links are not supported, even if publicly accessible. Only direct-access .mp4/H.264 URLs from public storage (e.g., S3, Dropbox raw link) can be used."
                  },
                  "video_consent_url ": {
                    "type": "string",
                    "description": "Public URL to the consent statement. Google Drive links are not supported, even if publicly accessible. Only direct-access .mp4/H.264 URLs from public storage (e.g., S3, Dropbox raw link) can be used."
                  },
                  "avatar_name": {
                    "type": "string",
                    "description": "Name to assign to the avatar."
                  },
                  "avatar_group_id": {
                    "type": "string",
                    "description": "Unique identifier of the existing avatar group. Can be retrieved from the <a href=\"https://docs.heygen.com/reference/create-photo-avatar-group\" target=\"_blank\">Create Photo Avatar Group</a> endpoint. If not provided, a new group is created."
                  },
                  "callback_id": {
                    "type": "string",
                    "description": "Custom ID for callback purposes. Returned in the status/webhook payload for tracking."
                  },
                  "callback_url": {
                    "type": "string",
                    "description": "URL to notify when video rendering is complete, useful when your callback endpoint is dynamic and each video requires a separate callback. Using a webhook endpoint is still the recommended approach, as it provides more customization options such as secrets, event filtering, and more. If both `webhook` and `callback_url` are used, events will be sent to both endpoints."
                  }
                },
                "required": [
                  "training_footage_url ",
                  "video_consent_url ",
                  "avatar_name"
                ]
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```