Import Contacts via API

This guide explains how to set up your webhook to programmatically import contacts into your HeyGen Personalized Video campaign via the API.

This feature is available exclusively for Enterprise users.

Creating Campaign through the Interface

To create templates, visit HeyGen Personalized Video: Create page and select "Pick a template" to begin.

On the "Import contacts" page, choose the Import via API option.

Connecting to Your HeyGen Webhook

On this step page, you need to connect to your webhook with a test request. To do this, copy the Project ID in this page and add it to project_id paramater in your request and make an initial Add Contact request. After submitting the request, the Connection status will change to Connected within a few seconds.

After completing all the steps and creating a campaign, you can add new contacts to your campaign by making an Add Contact request.

Add Contact

See detailed API reference
Use this request to add contacts to your campaign.

curl --location 'https://api.heygen.com/v1/personalized_video/add_contact' \
--header 'accept: application/json' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "project_id": "<project_id>",
  "variables_list": [
    {
      "first_name": "value1",
      "email": "[email protected]"
    }
  ]
}'
{
  "code": 100,
  "data": null,
  "msg": null,
  "message": "<message>"
}
  • project_id: The unique identifier for your project. This ID links the contact to the specific campaign you have created.
  • variables_list: A list of objects, each representing a contact informations to be added to the campaign. You can include additional fields in the variables_list objects depending on the personalization variables defined in your campaign.

Conclusion

This guide has outlined the steps to set up your webhook for importing contacts into your HeyGen Personalized Video campaign. By following these steps, you can programmatically import contacts into your campaign from any source.