Output Videos via API
This guide explains how to programmatically output generated videos from your HeyGen Personalized Video project using the API.
This feature is available exclusively for Enterprise users.
This guide assumes you've already created a personalized video project.
Configure Output via API for Your Personalized Video Project
Navigate to your personalized video project and select the Send via API option..
Register your target URL with our webhook event by inputting it here. This setup ensures that whenever a video is done generating, HeyGen will trigger an event to send the payload to your specified URL.
Alternatively, you can register a webhook using the API. For more details, refer to: Register a Webhook Endpoint
Sample payload
Once a video has completed generating, HeyGen's webhook will push a payload to your API. Here is a sample of the payload you can expect:
{
"event_type": "personalized_video",
"event_data": {
"project_id": "79c7ea088217434b9796626d93f1ddf7",
"video_id": "5743ee6fc10348bfa7703a52c456a6d4",
"video_url": "https://resource2.heygen.ai/personalized_video/video/86e21134dc934f89903482682ec263d2/b9eec703a2cd4242be0623cdc52c16d3.mp4",
"landing_page_url": "https://app.heygen.com/personalized-video/share/cdd94c46c8a54b45ac705597e50573e2/574c16e52f8247188363bdb575ae2976",
"gif_url": "https://resource2.heygen.ai/personalized_video/gif/86e21134dc934f89903482682ec263d2/2b7cbca10f4244c9aed9ebef64676404.gif",
"gif_html": "<div><img style=\"height: 270px\" src=\"https://resource2.heygen.ai/personalized_video/gif/86e21134dc934f89903482682ec263d2/2b7cbca10f4244c9aed9ebef64676404.gif\" alt=\"preview image\" /></div>",
"contact_info": {
"email": "[email protected]",
"first_name": "Josh"
}
}
}
Conclusion
This guide has outlined the steps to configure video output from your HeyGen Personalized Video project via API. By following these steps, you can programmatically direct video outputs to any desired source, enabling efficient and automated video delivery.
Updated 7 days ago