> ## 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.

# Send Webhook Events Again

> Resend a HeyGen webhook event from the last 30 days to one of its endpoints or its callback URL with POST /v3/webhooks/events/{event_id}/redeliver, track the resend, and recover the events missed during an outage.

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

HeyGen retries a webhook for only [about 35 seconds](https://www.heygen.com/docs/webhook-retries.md#retry-timing). If your server was down longer, rejected events because of a bug, or lost them after answering `200`, send them again with [`POST /v3/webhooks/events/{event_id}/redeliver`](https://www.heygen.com/docs/reference/send-webhook-event-again).

## Access

* Authenticate with an [API key](https://www.heygen.com/docs/api-key.md) or an OAuth token. A restricted key needs the `webhooks:write` [scope](https://www.heygen.com/docs/api-key-permissions.md) to send, and `webhooks:read` to find events and check the result.
* You can send again any event your workspace received in the last **30 days**.

## Send an event again

**1. Find the event and its target**

Get the event's `event_id` and its targets from [`GET /v3/webhooks/events`](https://www.heygen.com/docs/reference/list-webhook-events), filtered by `entity_id` (the job's ID) or a time range. Each entry in the event's `deliveries` names a target it was sent to; see [Monitor deliveries](https://www.heygen.com/docs/webhook-deliveries.md#check-delivery-status-per-event).

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

**2. Send it again**

Name one target in the body: an endpoint the event was sent to, or the `callback_url` of the request that created the job.

```bash To an endpoint theme={null}
curl -X POST "https://api.heygen.com/v3/webhooks/events/4b1f0c9e2a7d4e3f8c6b5a4d3e2f1a0b/redeliver" \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 2c7d0e94-5b1a-4f3e-9d62-8a0b1c2d3e4f" \
  -d '{"target": {"type": "endpoint", "endpoint_id": "ep_abc123def456"}}'
```

```bash To the callback URL theme={null}
curl -X POST "https://api.heygen.com/v3/webhooks/events/4b1f0c9e2a7d4e3f8c6b5a4d3e2f1a0b/redeliver" \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target": {"type": "callback"}}'
```

```bash CLI theme={null}
heygen webhook events redeliver 4b1f0c9e2a7d4e3f8c6b5a4d3e2f1a0b \
  -d '{"target": {"type": "endpoint", "endpoint_id": "ep_abc123def456"}}'
```

The resend runs in the background. The answer is `202 Accepted` with the new delivery's ID:

```json theme={null}
{
  "data": {
    "delivery_id": "3f0c9b1e2d4a4b6c8e7f1a2b3c4d5e6f",
    "event_id": "4b1f0c9e2a7d4e3f8c6b5a4d3e2f1a0b",
    "target": { "type": "endpoint", "endpoint_id": "ep_abc123def456" }
  }
}
```

**3. Check the result**

The resend's attempt appears in [`GET /v3/webhooks/deliveries`](https://www.heygen.com/docs/reference/list-webhook-deliveries) with `trigger` set to `send_again`, usually within a few seconds:

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

Find the entry whose `delivery_id` matches the one you got back, and read its `outcome`.

## What your server receives

A resend is the same event, delivered again:

* **Same `x-heygen-event-id`** as the first delivery, so a server that [deduplicates on it](https://www.heygen.com/docs/webhook-retries.md#deduplicate-and-order) skips an event it already processed. To process an event again on purpose, remove its ID from your store first.
* **A new `x-heygen-delivery-id`**, the `delivery_id` in the `202` answer, with `x-heygen-delivery-attempt: 1`.
* **The same `event_data`** as first sent, except that download URLs in it, such as `url` on `avatar_video.success`, are signed again so they work. If the video has since been withheld by moderation, its media links are `null`.
* **Signed with the endpoint's current secret.** If you [rotated the secret](https://www.heygen.com/docs/webhooks.md#rotate-signing-secret) since the event first went out, verify with the new one. Deliveries to a callback URL are not signed.

## Limits

* **One attempt.** A resend makes one attempt with a 5-second timeout and is not retried, whatever your server answers. If it fails, fix the cause and send the event again.
* **30 days.** Older events answer `409` `webhook_event_expired`.
* **Its own targets only.** You can send an event only to an endpoint it was sent to, or to the callback URL of its request. Events created before HeyGen recorded each event's targets can go to any current endpoint that subscribes to their event type, or to the `callback_url` in their data.
* **Enabled endpoints only.** A disabled endpoint answers `409` `webhook_endpoint_disabled`, and a deleted one `404` `webhook_not_found`.
* **One at a time per target.** While a resend of an event to a target is running, or for up to four minutes after it was accepted if its outcome is not yet known, another resend of the same event to the same target answers `409` `webhook_redelivery_in_progress`.
* **Five per workspace.** A workspace can have at most 5 resends queued or running at once. More answer `429` `webhook_redelivery_limit_exceeded`, without a `Retry-After` header. Each resend finishes within seconds, so send them one after another rather than all at once.

## Errors

| Status | `error.code` | Meaning | What to do |
| - | - | - | - |
| `400` | [`webhook_target_not_allowed`](https://www.heygen.com/docs/error-codes#webhook_target_not_allowed) | The target is not one the event was sent to, or `callback` when the request set no callback URL. | Pick a target from the event's `deliveries`. |
| `404` | `not_found` | No event with this ID in your workspace. | Check the `event_id`. |
| `404` | [`webhook_not_found`](https://www.heygen.com/docs/error-codes#webhook_not_found) | The endpoint was deleted. Nothing is sent. | Send the event to another of its targets. |
| `409` | [`webhook_event_expired`](https://www.heygen.com/docs/error-codes#webhook_event_expired) | The event is older than 30 days. | Read its data from `GET /v3/webhooks/events` instead. |
| `409` | [`webhook_endpoint_disabled`](https://www.heygen.com/docs/error-codes#webhook_endpoint_disabled) | The endpoint is disabled. | Use an enabled endpoint. |
| `409` | [`webhook_redelivery_in_progress`](https://www.heygen.com/docs/error-codes#webhook_redelivery_in_progress) | A resend of this event to this target is running or was just accepted. | Check its attempts in `GET /v3/webhooks/deliveries?event_id=...`, and send again only if they failed. |
| `409` | [`request_in_progress`](https://www.heygen.com/docs/error-codes#request_in_progress) | A request with the same `Idempotency-Key` is still running. | Wait, then retry with the same key. |
| `429` | [`webhook_redelivery_limit_exceeded`](https://www.heygen.com/docs/error-codes#webhook_redelivery_limit_exceeded) | Your workspace has 5 resends queued or running. | Wait a few seconds for one to finish. |
| `429` | [`rate_limit_exceeded`](https://www.heygen.com/docs/error-codes#rate_limit_exceeded) | Too many requests. | Wait for `Retry-After`. |
| `500` | [`internal_error`](https://www.heygen.com/docs/error-codes#internal_error) | The resend could not be started. Nothing was sent. | Send the event again. |
| `503` | [`service_unavailable`](https://www.heygen.com/docs/error-codes#service_unavailable) | HeyGen could not check whether a resend of the event is already running. Nothing was started. | Retry after a short delay. |
| `503` | [`service_unavailable`](https://www.heygen.com/docs/error-codes#service_unavailable) | The resend may have started, but HeyGen could not confirm it. The message says so. | Check `GET /v3/webhooks/deliveries?event_id=...` before sending again. A repeat within four minutes can answer `webhook_redelivery_in_progress`. |

Send an `Idempotency-Key` header so a retry after a network error returns the first answer instead of starting a second resend.

## Resend after an outage

This script finds the events your endpoint did not receive in a time window and sends them again one at a time, waiting for each resend to finish before the next. It skips `unknown` deliveries, which have no record and may have arrived: check those against your own logs.

```python theme={null}
import os
import time
import uuid

import requests

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


def failed_events(start_ts: int, end_ts: int):
    """Event IDs whose latest delivery to ENDPOINT_ID failed."""
    params = {"start_ts": start_ts, "end_ts": end_ts, "limit": 100}
    while True:
        page = requests.get(f"{BASE}/events", headers=HEADERS, params=params, timeout=30).json()
        for event in page["data"]:
            for delivery in event.get("deliveries") or []:
                target = delivery["target"]
                if target.get("endpoint_id") == ENDPOINT_ID and delivery["status"] == "failed":
                    yield event["event_id"]
        if not page["has_more"]:
            return
        params["token"] = page["next_token"]


def send_again(event_id: str) -> str:
    """Send one event again and return the resend's outcome."""
    response = requests.post(
        f"{BASE}/events/{event_id}/redeliver",
        headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
        json={"target": {"type": "endpoint", "endpoint_id": ENDPOINT_ID}},
        timeout=30,
    )
    if response.status_code != 202:
        return response.json()["error"]["code"]

    delivery_id = response.json()["data"]["delivery_id"]
    for _ in range(10):
        time.sleep(2)
        attempts = requests.get(
            f"{BASE}/deliveries", headers=HEADERS, params={"event_id": event_id, "limit": 20}, timeout=30
        ).json()["data"]
        for attempt in attempts:
            if attempt["delivery_id"] == delivery_id:
                return attempt["outcome"]
    return "pending"


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

## Related

> [card] [Monitor deliveries](https://www.heygen.com/docs/webhook-deliveries.md)
>
> Every attempt's status code, error class and latency.

> [card] [Delivery and retries](https://www.heygen.com/docs/webhook-retries.md)
>
> Headers, timeouts, and which answers are retried.


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