> For the complete documentation index, see [llms.txt](https://docs.tokenbot.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tokenbot.com/home/api-docs/webhooks/delivery.md).

# Delivery

## Delivery Behavior

* Requests are sent as HTTP POST with `Content-Type: application/json`
* Your endpoint must respond with `2xx` within 30 seconds
* Non-2xx responses or timeouts trigger retries

## Retry Policy

Failed deliveries are retried with exponential backoff, up to **5 attempts**:

| Attempt | Delay before attempt |
| ------- | -------------------- |
| 1       | Immediate            |
| 2       | 5 seconds            |
| 3       | 30 seconds           |
| 4       | 2 minutes            |
| 5       | 10 minutes           |

After the final failed attempt, the delivery is moved to the dead letter queue (DLQ).

## Dead Letter Queue

Failed deliveries are stored in the DLQ for manual inspection and replay.

### DLQ Endpoints

| Method | Path                                       | Description        |
| ------ | ------------------------------------------ | ------------------ |
| GET    | `/webhooks/:id/dead-letters`               | List dead letters  |
| GET    | `/webhooks/:id/dead-letters/:dlqId`        | Get dead letter    |
| POST   | `/webhooks/:id/dead-letters/:dlqId/replay` | Replay delivery    |
| DELETE | `/webhooks/:id/dead-letters/:dlqId`        | Delete dead letter |
| GET    | `/webhooks/:id/dead-letters/stats`         | DLQ stats          |

### Replay a Failed Delivery

```bash
curl -X POST https://api.tokenbot.com/v1/webhooks/wh_123/dead-letters/dlq_456/replay \
  -H "X-API-Key: tb_live_your_key"
```

## Idempotency

Each event includes a unique `event_id`. Use this to deduplicate events in case of retries or replays.

## Disabling Webhooks

If your endpoint fails consistently (10+ consecutive failures), the webhook may be automatically deactivated. You'll receive an email notification.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tokenbot.com/home/api-docs/webhooks/delivery.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
