# Delivery and retries

> How Allo delivers webhooks, retries failures, and handles recovery

## Delivery requirements

Your endpoint must:
- Return a **2xx** status code (200–299) within **20 seconds**.
- Be publicly accessible over HTTPS.

Any non-2xx response, timeout, or connection failure counts as a failed delivery.

## Retry schedule

When a delivery fails, Allo retries automatically with exponential backoff:

| Attempt | Delay after previous | Total elapsed |
|:-------:|---------------------|---------------|
| 1 | Immediate | 0 |
| 2 | 5 seconds | ~5 seconds |
| 3 | 5 minutes | ~5 minutes |
| 4 | 30 minutes | ~35 minutes |
| 5 | 2 hours | ~2.5 hours |
| 6 | 5 hours | ~7.5 hours |
| 7 | 10 hours | ~17.5 hours |
| 8 | 10 hours | ~27.5 hours |

After 8 attempts (~27.5 hours), the message is marked as **Failed**.

## Circuit breaker

Allo automatically disables endpoints that fail persistently. The process works as follows:

1. Multiple deliveries must fail within a 24-hour window, with at least 12 hours between the first and last failure. A brief outage does not trigger the circuit breaker.
2. Once that condition is met, a 5-day timer starts.
3. If all delivery attempts continue to fail for **5 consecutive days**, the endpoint is automatically disabled.

To recover:
1. Fix the issue with your endpoint.
2. Go to [Settings > Webhooks](https://web.withallo.com/settings/webhooks) and re-enable the webhook.
3. Use the **Recover** option in the webhook settings to replay missed events.

## Inspecting deliveries

You can inspect delivery attempts, view payloads, and check response details from [Settings > Webhooks](https://web.withallo.com/settings/webhooks). Select a webhook to see its delivery history, filter by status, and drill into individual deliveries.

## Retry and recovery

From the webhook settings UI you can:

- **Retry** a specific failed delivery immediately.
- **Recover** missed events by replaying all deliveries since a given date. Use this after fixing a broken endpoint or recovering from downtime.

## Delivery guarantees

Allo uses **at-least-once** delivery. Events may be delivered more than once. Implement idempotency in your handler using the `webhook-id` header. See [Best practices](/docs/webhooks/best-practices).
