This page describes what HeyGen sends to your server for each webhook event, what your server should answer, and what happens when it does not. The same rules apply to registered endpoints and to a per-request callback_url.
Where an event is sent
When a job reaches a state that has an event, such as a video finishing, HeyGen sends the event to every target it has:- each enabled endpoint in your workspace that subscribes to that
event_type(an endpoint withevents: nullsubscribes to all of them); - the
callback_urlthat the request which created the job set, if it set one.
status is enabled receive events.
The request
Each attempt is aPOST to the target URL. The body is a compact JSON object with two fields:
event_data depends on the event type; see Webhook Events.
The event ID is in the headers only, not in the body. The same ID is the
event_id in GET /v3/webhooks/events and GET /v3/webhooks/deliveries, so you can look up any request your server received.
What your server should answer
Answer with any2xx status within 5 seconds. Do the real work after you answer: store the event, put it on a queue, answer 200, and process it from the queue. A handler that renders, transcodes, or calls other services before it answers will time out, and the attempt is retried.
How each answer is treated:
Answer
4xx only when the request itself is wrong, such as a bad signature. If your server is overloaded or a dependency is down, answer 503 or 429 so the attempt is retried.
Retry timing
- A delivery makes at most 5 attempts.
- The wait between attempts is about 2, 4, 8 and 8 seconds, each varied by up to 25%.
- A
Retry-Afterheader in seconds on a retried answer, such as a429or503, sets the shortest wait before the next attempt. ARetry-Afterlonger than the time left ends the delivery as failed. ARetry-Aftergiven as a date is ignored. - All of an event’s deliveries share one 35-second limit, counted from the first attempt. When the next attempt cannot start within it, the delivery ends as failed.
GET /v3/webhooks/events and send them again, or fetch the jobs’ state from the API.
URL requirements
A target URL must:- use
https, on port 443, 8443, 8080, 8000 or 80; - have a host name that resolves only to public IPv4 addresses. A receiver reachable only over IPv6 is not reached;
- carry no user name or password (
https://user:pass@...); - answer directly, without a redirect.
error_class non_public or redirect_refused, which are not retried.
Deduplicate and order
Delivery is at least once. Your server can receive the same event more than once when:- your server processed an attempt but its answer was lost or late, so the attempt was retried;
- the event was sent again;
- the event has two targets that reach the same system, such as an endpoint and a
callback_url.
x-heygen-event-id you have processed, and skip one you have already seen. Keep the IDs for at least 30 days, the period in which an event can be sent again.
Media URLs in events
Download URLs inevent_data, such as url on avatar_video.success, are pre-signed and expire. Download the file soon after the event arrives, or fetch a fresh URL from the job’s get endpoint; see Webhook Events. GET /v3/webhooks/events and Send again sign these URLs again, so they return working links.
Next steps
Monitor deliveries
See each attempt’s status code, error and latency, and find events that never arrived.
Send events again
Resend an event from the last 30 days to an endpoint or callback URL.

