> ## Documentation Index
> Fetch the complete documentation index at: https://www.heygen.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor Webhook Deliveries

> Check whether HeyGen webhooks reached your server with GET /v3/webhooks/deliveries and the deliveries field of GET /v3/webhooks/events: every attempt's status code, error class and latency, filtered by endpoint, job or outcome.

![](https://mintcdn.com/heygen-1fa696a7/-JfaMNWMFzwSpwo3/docs/images/theme/research-3.webp?fit=max\&auto=format\&n=-JfaMNWMFzwSpwo3\&q=85\&s=732f93b6a37facb6b4006c37ea0d276d)

HeyGen records every attempt to deliver a webhook: where it went, what your server answered, and how long it took. Use these records to find out why a webhook did not arrive, to watch an endpoint's failure rate, and to pick the events to [send again](https://www.heygen.com/docs/webhook-send-again.md).

There are two views of the same records:

| Question | Use |
| - | - |
| Did this event reach each of its targets? | The `deliveries` field of [`GET /v3/webhooks/events`](https://www.heygen.com/docs/reference/list-webhook-events): the latest outcome per target, one row per event. |
| What happened on each attempt? | [`GET /v3/webhooks/deliveries`](https://www.heygen.com/docs/reference/list-webhook-deliveries): one row per HTTP attempt, retries and resends included. |

## Access

* Authenticate with an [API key](https://www.heygen.com/docs/api-key.md) or an OAuth token. A restricted key needs the `webhooks:read` [scope](https://www.heygen.com/docs/api-key-permissions.md).
* Both lists cover the workspace the key or token belongs to.
* Attempts are kept for **30 days**.

## Check delivery status per event

Each event in [`GET /v3/webhooks/events`](https://www.heygen.com/docs/reference/list-webhook-events) has a `deliveries` array with one entry per target: each endpoint the event was sent to, and the request's `callback_url` if it set one. Filter with `event_type`, `entity_id` (the job's ID, such as a video ID), and a creation-time range in Unix seconds with `start_ts` and `end_ts`.

```bash theme={null}
curl "https://api.heygen.com/v3/webhooks/events?entity_id=8d3c2f0a1b4e4c6d9e7f0a1b2c3d4e5f" \
  -H "X-Api-Key: $HEYGEN_API_KEY"
```

```json theme={null}
{
  "data": [
    {
      "event_id": "4b1f0c9e2a7d4e3f8c6b5a4d3e2f1a0b",
      "event_type": "avatar_video.success",
      "event_data": {
        "video_id": "8d3c2f0a1b4e4c6d9e7f0a1b2c3d4e5f",
        "url": "https://...",
        "callback_id": "order-1042"
      },
      "created_at": "2026-12-02T18:04:11Z",
      "deliveries": [
        {
          "status": "failed",
          "status_code": 503,
          "attempt_count": 5,
          "last_attempt_at": "2026-12-02T18:04:34Z",
          "target": {
            "type": "endpoint",
            "endpoint_id": "ep_abc123def456",
            "endpoint_label": "https://hooks.example.com#9f86d081884c"
          }
        },
        {
          "status": "succeeded",
          "status_code": 200,
          "attempt_count": 1,
          "last_attempt_at": "2026-12-02T18:04:12Z",
          "target": {
            "type": "callback",
            "callback_label": "https://example.com#3b5d5c371295"
          }
        }
      ]
    }
  ],
  "has_more": false,
  "next_token": null
}
```

| Field | Description |
| - | - |
| `status` | The outcome of the latest attempt to this target: `succeeded`, `failed`, or `unknown`. |
| `status_code` | The HTTP status your server answered on that attempt. Left out when no answer decided it, for example on a timeout, or when the status is `unknown`. |
| `error_class` | Why the attempt ended without a deciding answer; see [Error classes](#error-classes). Left out when `status_code` decides it. |
| `attempt_count` | Attempts recorded to this target, [Send again](https://www.heygen.com/docs/webhook-send-again.md) included. |
| `last_attempt_at` | When the latest attempt was made, ISO 8601 UTC. Left out when the status is `unknown`. |
| `target` | Where the event was sent; see [Targets](#targets). |

> [!NOTE]
>
> A field with no value is left out of the response instead of being returned as `null`. For example, a timed-out attempt has no `status_code` key. Read optional fields with `.get()` or an equivalent.

`unknown` means no attempt is recorded for that target. It does not prove that nothing was sent: events from before HeyGen started recording attempts have no records, and a record can be lost after its request went out. Check your own logs for the event ID before you send an `unknown` event again. `deliveries` is left out of the response while delivery records cannot be read.

## List delivery attempts

[`GET /v3/webhooks/deliveries`](https://www.heygen.com/docs/reference/list-webhook-deliveries) returns one entry per HTTP attempt, newest first. With no filters it returns the last 30 days.

```bash theme={null}
curl "https://api.heygen.com/v3/webhooks/deliveries?endpoint_id=ep_abc123def456&outcome=failed&limit=50" \
  -H "X-Api-Key: $HEYGEN_API_KEY"
```

With the [HeyGen CLI](https://www.heygen.com/docs/cli.md):

```bash theme={null}
heygen webhook deliveries list --endpoint-id ep_abc123def456 --outcome failed --limit 50
```

| Query parameter | Description |
| - | - |
| `endpoint_id` | Only attempts to this endpoint. |
| `event_id` | Only attempts to deliver this event. |
| `event_type` | Only events of this type, such as `avatar_video.success`. |
| `entity_id` | Only events about this job, such as a video ID or translation ID. |
| `outcome` | `succeeded` or `failed`. |
| `start_ts`, `end_ts` | The time range, in Unix seconds. `end_ts` defaults to now, and `start_ts` to 30 days before `end_ts`. `start_ts` after `end_ts` returns `400`. |
| `limit` | Attempts per page, 1–100. Default `10`. |
| `token` | The `next_token` from the previous page. Send it with the same filters and range. |

```json theme={null}
{
  "data": [
    {
      "attempt_id": "a7c1e0d24f3b4a5c9d8e7f6a5b4c3d2e",
      "delivery_id": "3f0c9b1e2d4a4b6c8e7f1a2b3c4d5e6f",
      "event_id": "4b1f0c9e2a7d4e3f8c6b5a4d3e2f1a0b",
      "event_type": "avatar_video.success",
      "entity_id": "8d3c2f0a1b4e4c6d9e7f0a1b2c3d4e5f",
      "target": {
        "type": "endpoint",
        "endpoint_id": "ep_abc123def456",
        "endpoint_label": "https://hooks.example.com#9f86d081884c"
      },
      "trigger": "automatic",
      "attempt": 5,
      "status_code": 503,
      "outcome": "failed",
      "is_redirected": false,
      "latency_ms": 212,
      "created_at": "2026-12-02T18:04:34.118Z"
    }
  ],
  "has_more": true,
  "next_token": "eyJjIjoiMjAyNi0xMi0wMlQxODowNDozNC4xMThaIn0"
}
```

| Field | Description |
| - | - |
| `attempt_id` | This attempt's ID. |
| `delivery_id` | Shared by the attempts of one delivery. Your server received it as `x-heygen-delivery-id`. |
| `event_id` | The event. Your server received it as `x-heygen-event-id`. |
| `event_type` | The event type. |
| `entity_id` | The job the event is about, such as a video ID. Left out when unknown. |
| `target` | Where the attempt was sent; see [Targets](#targets). |
| `trigger` | `automatic` when sent because the event happened; `send_again` for a [resend](https://www.heygen.com/docs/webhook-send-again.md). |
| `attempt` | The attempt number within the delivery, from `1`. Your server received it as `x-heygen-delivery-attempt`. |
| `status_code` | The HTTP status your server answered. Left out when no answer decided the attempt. |
| `error_class` | Why the attempt ended without a deciding answer; see [Error classes](#error-classes). Left out when `status_code` decides it. |
| `outcome` | `succeeded` for a `2xx`; `failed` otherwise. |
| `is_redirected` | Always `false`: a redirect fails the attempt instead of being followed. |
| `latency_ms` | Milliseconds until your server answered. Left out when nothing was sent. |
| `created_at` | When the attempt was made, ISO 8601 UTC. |

A missing attempt does not prove that nothing was sent, for the same reason as `unknown` above.

### Targets

| `target.type` | Fields |
| - | - |
| `endpoint` | `endpoint_id`, and `endpoint_label` while the endpoint still exists (left out once it is deleted). |
| `callback` | `callback_label`. |

Labels show the URL's scheme and host, then `#` and a 12-character fingerprint in place of the path, because a webhook path often holds a secret token. HeyGen never stores or returns the full path, the body, the headers, or the signature of a delivery.

## Error classes

`error_class` is present when an attempt ended without an HTTP answer that decided it, or when your server answered with a redirect.

| `error_class` | Meaning | Retried | What to do |
| - | - | - | - |
| `timeout` | Your server did not answer within 5 seconds, or the delivery's 35-second limit ran out before the attempt could start. | Yes | Answer `200` first and process the event afterwards; see [What your server should answer](https://www.heygen.com/docs/webhook-retries.md#what-your-server-should-answer). |
| `connection` | The connection was refused or reset, TLS failed, or the host name could not be resolved. | Yes | Check that the host is up, its DNS resolves, and its TLS certificate is valid. |
| `non_public` | The URL is not a public HTTPS address on an allowed port, or its host resolves to a private address. Nothing was sent. | No | Use a URL that meets the [URL requirements](https://www.heygen.com/docs/webhook-retries.md#url-requirements). |
| `redirect_refused` | Your server answered with a redirect. | No | Register the final URL, without the redirect. A common cause is `http` to `https`, or a missing or extra trailing slash. |
| `redirect_limit` | No longer produced. It can appear on older attempts. | No | As for `redirect_refused`. |
| `endpoint_deleted` | The endpoint was deleted or disabled after a [Send again](https://www.heygen.com/docs/webhook-send-again.md) was accepted. Nothing was sent. | No | Send the event to another of its targets. |
| `internal` | The attempt failed on HeyGen's side, for example a resend could not sign the event's media URLs again. | No | Wait a few minutes, then [send the event again](https://www.heygen.com/docs/webhook-send-again.md). |

Common status codes from your server:

| `status_code` | Likely cause |
| - | - |
| `401` or `403` | Your signature check failed. Check that the verifier uses the endpoint's current secret after a [rotation](https://www.heygen.com/docs/webhooks.md#rotate-signing-secret), and that it hashes the raw body. Not retried. |
| `404` or `405` | The path or method is wrong, or the route was removed. Not retried. |
| `400` or `422` | Your server rejected the body. Check that it accepts every `event_type` the endpoint subscribes to. Not retried. |
| `413` | Your server's body size limit is too small. Not retried. |
| `429`, `500`, `502`, `503`, `504` | Your server or a proxy in front of it was overloaded or down. Retried for about 35 seconds. |

## Recipes

### Why did my server not get the webhook for a job?

Filter by the job's ID:

```bash theme={null}
curl "https://api.heygen.com/v3/webhooks/deliveries?entity_id=8d3c2f0a1b4e4c6d9e7f0a1b2c3d4e5f" \
  -H "X-Api-Key: $HEYGEN_API_KEY"
```

* **No attempts:** check that an enabled endpoint subscribes to the event type, or that the request set a `callback_url`. Check [`GET /v3/webhooks/events`](https://www.heygen.com/docs/reference/list-webhook-events) with the same `entity_id` to see whether the event happened.
* **`succeeded`:** your server answered `2xx`. Search your server's logs for the `event_id`.
* **`failed`:** read `status_code` or `error_class` above, fix the cause, then [send the event again](https://www.heygen.com/docs/webhook-send-again.md).

### Find events that did not arrive

After an outage, list the events in the outage window and keep those whose delivery to your endpoint did not succeed:

```python theme={null}
import os
import requests

API = "https://api.heygen.com/v3/webhooks/events"
HEADERS = {"X-Api-Key": os.environ["HEYGEN_API_KEY"]}
ENDPOINT_ID = "ep_abc123def456"


def undelivered_events(start_ts: int, end_ts: int):
    params = {"start_ts": start_ts, "end_ts": end_ts, "limit": 100}
    while True:
        page = requests.get(API, headers=HEADERS, params=params, timeout=30).json()
        for event in page["data"]:
            for delivery in event.get("deliveries") or []:
                target = delivery["target"]
                if target["type"] == "endpoint" and target.get("endpoint_id") == ENDPOINT_ID:
                    if delivery["status"] != "succeeded":
                        yield event["event_id"], delivery["status"]
        if not page["has_more"]:
            return
        params["token"] = page["next_token"]


# 2026-12-02 18:00 to 19:00 UTC
for event_id, status in undelivered_events(1796234400, 1796238000):
    print(event_id, status)
```

Send `failed` events again with [Send again](https://www.heygen.com/docs/webhook-send-again.md#resend-after-an-outage). Check `unknown` ones against your own logs first.

### Watch an endpoint's failure rate

Poll `GET /v3/webhooks/deliveries?endpoint_id=...&outcome=failed&start_ts=...` every few minutes with `start_ts` set to the previous poll, and alert when the count rises. Count deliveries rather than attempts: group by `delivery_id`, because one delivery can make up to 5 failed attempts.

## Next steps

> [card] [Send events again](https://www.heygen.com/docs/webhook-send-again.md)
>
> Resend an event from the last 30 days once your server is fixed.

> [card] [Delivery and retries](https://www.heygen.com/docs/webhook-retries.md)
>
> Which answers are retried, and for how long.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.