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

# Delivery and recovery

> How Prava delivers and retries events, pauses failing endpoints, and how to recover what you missed.

Prava delivers each event **at least once**. The same event can arrive more than once, and events can arrive out of order. Deduplicate by event `id` and don't depend on delivery order.

## Responding to an event

Store the event, return a `2xx` status, then process it asynchronously. Prava treats anything else as a failed attempt:

* a non-`2xx` status
* a redirect (Prava doesn't follow redirects)
* a DNS, TLS or connection error
* a timeout

| Limit | Value |
| - | - |
| Connect timeout | 3 seconds |
| Total request timeout | 10 seconds |
| Request body | Up to 64 KiB |
| Response body | Prava reads the first 4 KiB. A `2xx` still counts if the body is longer or the connection closes early. |
| Verification response | A complete JSON body echoing `challenge`, within 4 KiB |
| Concurrency | One request at a time per endpoint, and at most two at a time (five per second) across your application |

## Retries

A failed delivery gets up to **9 attempts over 72 hours**. Each attempt is scheduled from when the delivery was created, plus up to 5 seconds of jitter:

| Attempt | Earliest send time |
| - | - |
| 1 | Immediately |
| 2 | 30 seconds |
| 3 | 2 minutes |
| 4 | 10 minutes |
| 5 | 1 hour |
| 6 | 6 hours |
| 7 | 24 hours |
| 8 | 48 hours |
| 9 | About 72 hours |

* **`Retry-After`:** if your receiver sends it, Prava waits at least that long, up to 6 hours and never past the 72-hour window.
* **Problems on Prava's side** delay delivery without using one of your attempts.
* **Unknown outcomes** after a request was sent still use an attempt, because your receiver may have accepted it.

When the last attempt fails, the delivery becomes `exhausted`. You can [replay it](#replay-a-delivery) for 30 days.

## Endpoint health reasons

Prava counts consecutive failures for each endpoint and pauses one that keeps failing. The endpoint's `blocked_reason` tells you why:

| Trigger | What happens | `blocked_reason` |
| - | - | - |
| 5 failures in a row | Deliveries pause for 5 minutes, then a recovery attempt runs. | `RECEIVER_UNACKNOWLEDGED` |
| 8 failures in a row | The endpoint is paused (**Unhealthy · paused** in the Dashboard) until you [resume it](#resume-a-paused-endpoint). | `DELIVERY_FAILURE_LIMIT` |
| Your receiver returns `410 Gone` | Paused immediately. | `HTTP_GONE` |
| The URL resolves to a private or reserved address | Paused immediately. | `DESTINATION_BLOCKED` |

A `2xx` resets the failure count. One event running out of retries doesn't pause an otherwise healthy endpoint.

`blocked_reason` is `null` when nothing is blocking the endpoint, but that alone doesn't mean it's delivering. Check `enabled` and `verified_at` too.

### Which failures count

Every attempt in delivery history has an error category. Only clear receiver failures count toward a pause:

| Category | Counts toward a pause | Meaning |
| - | - | - |
| `HTTP_REJECTED` | Yes | A non-`2xx` response. |
| `REDIRECT_REFUSED` | Yes | A redirect response. |
| `RECEIVER_CONNECTION_REFUSED` | Yes | The connection was refused. |
| `RECEIVER_TLS_REJECTED` | Yes | A certificate or TLS problem, such as an expired, mismatched or self-signed certificate. |
| `RECEIVER_PROTOCOL_REJECTED` | Yes | A malformed HTTP response. |
| `RECEIVER_DNS_NOT_FOUND` | Yes | The domain has no A or AAAA records. |
| `DELIVERY_UNACKNOWLEDGED` | No | A timeout, network or resolver error, or another uncertain failure. Normal retries still apply. |

Uncertain failures neither count toward a pause nor reset the count. Categories describe what Prava observed; they don't prove which side caused an outage. Delivery history never includes raw DNS, certificate or response details.

## Pauses, URL changes and deletes

| Action | Effect on deliveries |
| - | - |
| Automatic pause (health or security) | New subscribed events are still queued, but nothing is sent. After you resume, they retry within their original 72-hour window. A pause never extends it. |
| Manual pause (`enabled: false`) | New events aren't queued for the endpoint. |
| URL change | Verification is cleared, the endpoint is paused, and deliveries queued for the old URL are cancelled. Verify the new URL, then enable it. |
| Delete | Outstanding deliveries are cancelled and the endpoint is removed. |

A request already in transit can't be recalled. Events from removed subscriptions, deleted endpoints and periods when webhooks were disabled aren't backfilled, and new endpoints don't receive past events. Use the [events feed](#recover-missed-events) to fill gaps.

> [!TIP]
>
> In sandbox, a stopped development tunnel is a common cause of pauses. Restart the tunnel, or pause the endpoint while you're not using it.

## Pause emails

When an endpoint is paused automatically, Prava emails every developer and administrator on the application who has a verified email address. The email names the endpoint, application and environment, and links to its settings.

* You get one email per outage. Individual exhausted events don't send email, and there are no reminder or recovery emails.
* After you resume, a new pause (eight new failures in a row) sends a new email. Changing the URL alone doesn't.

## Resume a paused endpoint

**1. Open the endpoint**

Open **Webhooks** in the developer dashboard and select the environment named in the email. In a multi-app workspace, open **Webhooks**, find the application and select **Manage webhooks**.

**2. Fix and test the receiver**

Restore the receiver or update its URL. Choose **Verify destination**, then **Send test event**. Direct tests work while delivery is paused.

**3. Resume delivery**

Choose **Resume delivery**. For a new URL, choose **Activate delivery** after verification. Either one releases the deliveries held during the pause. To test the retry path, activate first, then send an API test with `queued: true`.

**4. Check delivery history**

Held deliveries retry within their original window. Replay any exhausted deliveries you still need.

A queued delivery that returns `2xx`, including a test event, shows the receiver is healthy again. It doesn't confirm your own processing, and it doesn't resume an endpoint you paused manually. Resuming starts a new monitoring period.

## Delivery history

**Delivery history** in the Dashboard and the [deliveries API](https://docs.prava.space/api-reference/webhooks/list-deliveries.md) show each delivery's status, attempt times, HTTP status, error category and original event body, along with the endpoint's pause reason and open incidents. Your receiver's response bodies are never shown or logged.

Events, deliveries and attempts are kept for **30 days**. A replay made near the end of that window stays visible through its own 72-hour delivery window.

An exhaustion incident names the failed delivery. It closes when that event is replayed successfully, not when another delivery succeeds.

## Replay a delivery

Developers can replay a retained delivery to an endpoint that is verified, enabled and subscribed to the event. Administrators can also resolve endpoint problems. In the API, use [Replay a delivery](https://docs.prava.space/api-reference/webhooks/replay-delivery.md).

* The replay keeps the event `id` and body and creates a new delivery. It cancels that delivery's pending retries; a request already sent can't be recalled.
* Retrying with the same idempotency key returns the original replay, even if the URL has changed since. Use a new key to replay to a newly verified URL.
* Deliveries older than 30 days can't be replayed.

## Recover missed events

To catch up from your own system, read the events feed with your secret key:

1. Call `GET /v1/events?cursor=0`.
2. Process each page durably, then save its `next_cursor`.
3. Repeat with that cursor until `next_cursor` is `null`. You're caught up.
4. On later runs, start from the last non-null cursor you saved. Reprocessing the last partial page is safe when you deduplicate by event `id`.

* The cursor follows the order in which Prava recorded events in the environment. Gaps in the sequence are normal.
* Only your application's events are returned.
* Fetch one event with `GET /v1/events/{eventId}`.
* Events are recorded even when no endpoint is active, and kept for 30 days. For anything older, reconcile with the relevant API.
* These reads keep working while webhook delivery is disabled.

See [List events](https://docs.prava.space/api-reference/webhooks/list-events.md) for filters.


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