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

# Webhook retries and replays

> Design an idempotent receiver and recover safely from delivery failures

Signal marks any 2xx response as successful.
A network error, timeout, or non-2xx response is a failed attempt and can be retried with exponential backoff until the endpoint's retry budget is exhausted.

## Delivery history

Open an endpoint to inspect deliveries newest first.
A delivery records the event type, status, attempt count, last status code, last error, next-attempt time when applicable, and a limited response-body snippet.
Signal retains at most 4 KiB of the response snippet for this view.

## Receiver response rules

| Response                 | Signal behavior                                                                                         |
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
| 2xx                      | Marks the attempt successful                                                                            |
| 4xx                      | Treats the attempt as failed; use only when retry cannot help or your contract deliberately requires it |
| 5xx                      | Treats the attempt as failed and eligible for retry                                                     |
| Timeout or network error | Treats the attempt as failed and eligible for retry                                                     |

Return 2xx only after the event is durably accepted.
Do not wait for slow downstream business processing.

## Idempotent processing

Retries and manual replays can deliver the same logical event more than once.
Use a durable uniqueness key from the event or delivery context.

```text theme={"dark"}
begin transaction
  insert received_event(unique_event_id)
  if duplicate: commit and return
  apply business state transition
commit
```

Make external side effects idempotent too.
For example, derive a stable downstream key rather than creating a new refund, notification, or ticket on each attempt.

## Replay a delivery

Replay after you fix a transient outage, deploy a parser correction, or restore a downstream dependency.
Signal resends the original payload to the endpoint.

Before replaying:

1. Confirm the receiver accepts the event type.
2. Confirm signature verification uses the endpoint secret.
3. Confirm duplicate handling is active.
4. Replay one delivery.
5. Check the new attempt and downstream state before replaying a range.

## Disable or delete

Disable an endpoint when it should stop receiving matching new events temporarily.
Delete only when the endpoint is permanently retired.
Deletion also stops retries for in-flight deliveries.

<Warning>
  Do not replay events into a receiver that performs non-idempotent side effects.
  Fix deduplication first.
</Warning>
