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

# Retries and delivery

> What happens when your endpoint is down, and how to see it.

A delivery that does not return `2xx` is retried on a fixed schedule.

| Attempt | Sent after  |
| ------- | ----------- |
| 1       | immediately |
| 2       | 30 seconds  |
| 3       | 2 minutes   |
| 4       | 10 minutes  |
| 5       | 45 minutes  |
| final   | 2 hours     |

After the last attempt the delivery is marked `exhausted` and is not tried
again. That covers roughly three hours of downtime.

## What counts as a failure

* any status outside `2xx`, except `410`
* a connection error, DNS failure or TLS failure
* no response within **10 seconds**
* a redirect, which is never followed

`410 Gone` is treated as a deliberate retirement. Delivery stops immediately
with no further attempts.

## Delivery log

`GET /api/webhooks/deliveries` returns recent attempts, newest first. Filter
to one endpoint with `?endpoint_id=`.

```json theme={null}
{
  "id": 4821,
  "endpoint_id": "whe_4c1f8a2b9d7e3f6a5b0c2d1e",
  "event_type": "credits.low",
  "status": "succeeded",
  "attempts": 2,
  "response_code": 200,
  "created_at": "2026-09-19T14:03:11Z",
  "completed_at": "2026-09-19T14:03:42Z"
}
```

| `status`    | Meaning                                               |
| ----------- | ----------------------------------------------------- |
| `pending`   | Waiting for its next attempt.                         |
| `succeeded` | Acknowledged with a `2xx`.                            |
| `exhausted` | Every attempt failed, or the endpoint returned `410`. |

When an attempt fails, `response_code` and `error` record what came back. The
response body is captured up to 2 KB, which is usually enough to see why an
endpoint rejected a payload.

The same view is on the **Webhooks** page of the
[dashboard](https://app.truscan.co).

## Designing for retries

Acknowledge before you do the work. A `2xx` means received, not processed, and
anything you do before responding eats into the 10 second budget. Queue the
payload and return.

Deduplicate on the event `id`. A retry reuses it, and an endpoint that timed
out after succeeding will see the same event twice.

Deliveries are kept for **30 days**.
