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

# Delivery and retry behavior

> Understand webhook delivery via HTTPS POST, exponential backoff retries, and idempotency best practices.

Webhooks are delivered via HTTPS POST requests.

If delivery fails, Tesouro retries webhook delivery using an exponential backoff strategy. Events are retried until delivery succeeds or the 12-hour retry limit is reached. After this period, the event is permanently marked as failed.

Webhook events are delivered at least once; consumers should be idempotent.

### Retry schedule

| Attempt | Delay (from previous) | Cumulative time                        |
| :------ | :-------------------- | :------------------------------------- |
| 1       | Immediate             | 0 min                                  |
| 2       | 1 minute              | 1 min                                  |
| 3       | 5 minutes             | 6 min                                  |
| 4       | 15 minutes            | 21 min                                 |
| 5       | 30 minutes            | 51 min                                 |
| 6       | 1 hour                | 1h 51min                               |
| 7+      | 2 hours               | Continues at 2-hour intervals (capped) |

### Best practices

1. **Implement idempotency** – Retries may deliver the same event multiple times. Use the `applicationEventId` to detect and discard duplicates. The `attemptCount` field indicates whether a redelivery has occurred.
2. **Respond quickly** – Your endpoint must return a `200 OK` within 30 seconds. For longer processing, acknowledge the webhook immediately and hand off work to an asynchronous queue.
3. **Order events correctly** – Due to network latency and retries, events may arrive out of chronological order. Use the `attributes.updatedTimestamp` field to correctly sequence events.
4. **Verify signatures** – Always verify webhook signatures before processing events.
