# Delivery and retries

Webhook delivery is based on HTTP response semantics from your receiving
endpoint, with a bounded retry policy for temporary failures.

## Success responses

Webhook delivery is considered successful when your endpoint returns one of
these response codes:

- `200 OK`
- `201 Created`
- `202 Accepted`
- `203 Non-Authoritative Information`
- `204 No Content`
- `208 Already Reported`


Return one of these only after the event has been accepted for durable
processing.

## Retriable responses

Webhook delivery is retried when your endpoint returns one of these response
codes:

- `408 Request Timeout`
- `425 Too Early`
- `429 Too Many Requests`
- `500 Internal Server Error`
- `502 Bad Gateway`
- `503 Service Unavailable`
- `504 Gateway Timeout`


When one of these responses is returned, the sender checks for a `Retry-After`
header and uses it when present. `Retry-After` may be sent either as integer
seconds or as an HTTP date. If the header is missing or invalid, the sender
falls back to its default retry schedule.

## Retriable request errors

Webhook delivery is also retried when the HTTP request fails before a usable
response is received and the error is considered transient, for example a
temporary network failure or timeout.

## Default retry schedule

When `Retry-After` is not used, the sender retries using this backoff schedule:

- attempt 1: about `1 minute`
- attempt 2: about `5 minutes`
- attempt 3: about `15 minutes`
- attempt 4: about `30 minutes`
- attempt 5: about `1 hour`
- attempt 6: about `2 hours`
- attempt 7: about `4 hours`
- attempt 8 and later: about `6 hours`


Each default delay includes a small jitter of up to about `10%` to reduce retry
spikes across many failing deliveries.

## Retry limits

Retries stop when either of these limits is reached:

- `10` retry attempts
- a `24 hour` retry window measured from the first delivery attempt


If `Retry-After` is longer than the remaining retry window, the sender clamps
the delay to the remaining time. If no retry budget remains, the delivery is
treated as exhausted and no further attempts are made.

## Terminal failures

Any non-success response outside the retriable set is treated as a failed
delivery attempt without automatic retry.

In practice, this means that your endpoint should:

- return `2xx` after the event is durably accepted
- return a retriable status when a temporary dependency is unavailable
- avoid returning permanent `4xx` responses for recoverable capacity issues


## Integration guidance

To reduce unnecessary retries:

- acknowledge after enqueueing, not after full downstream processing
- use `429` or `503` when backpressure is temporary
- include `Retry-After` when you know when capacity will recover
- expect retries to continue for up to `24 hours` unless a success response is returned
- make event handling idempotent so repeated attempts are safe