Responses and retries
What your server must answer, how Bookline retries, what happens when your endpoint fails, ordering, duplicates and limits.
Bookline delivers every event at least once. If your server does not confirm it, we retry for 72 hours.
What to answer
Section titled “What to answer”| Your answer | What Bookline does |
|---|---|
Any 2xx within 10 seconds |
Delivered. The body of your answer is ignored |
410 Gone |
Stops: the delivery fails and the endpoint is disabled at once. Answer 410 only if you want no more events at that URL |
Any other code: 3xx, 4xx (including 429) or 5xx |
Retries later |
| No answer in 10 seconds, connection or TLS error | Retries later |
- The 10 seconds cover the whole exchange: connection, TLS and your response status.
- Redirects are not followed: a
301/302counts as a failure. Give us the final URL. - Answer quickly and do the work afterwards: put the event in a queue and answer
2xx. - Answer
2xxto duplicates, to test events and to event types you don’t handle; otherwise we will keep retrying them. - If the signature does not match, answer
400or401. It will be retried, which helps if the cause is a secret you have not updated yet.
Retries
Section titled “Retries”A failed delivery is retried with the same id and the same body. Only webhook-timestamp, the signature and bookline-attempt change.
| Retry | Time after the first attempt |
|---|---|
| 1 to 4 | 1 min, 5 min, 15 min, 1 h |
| 5 to 27 | Every hour, from 2 h up to 24 h |
| 28 to 35 | Every 6 hours, from 30 h up to 72 h |
Each retry can be sent up to 1 minute early, at random, so that retries for many events don’t arrive at the same instant. In total: the first attempt and up to 35 retries. After 72 hours without a 2xx the delivery is marked as failed. Bookline can resend it for 30 days; a resent delivery gets another 72 hours of retries.
Test events are sent once and never retried.
If your endpoint keeps failing
Section titled “If your endpoint keeps failing”- Pause. After 5 failures in a row we stop sending to your endpoint for a while. Waiting events are kept, not lost. We send one of them as a probe after 1, 5, 15 and 30 minutes, then every hour; as soon as one gets a
2xx, normal sending resumes. The 72-hour window of each delivery keeps running during the pause. - Disable. If your endpoint has been failing without interruption for 72 hours, or answers
410 Gone, Bookline disables it. Bookline is notified and will contact you. - Re-enable. While the endpoint is paused or disabled, new events are kept. When it is re-enabled, Bookline can send the ones younger than 72 hours, oldest first, or skip them. Failed or skipped events can be resent for 30 days.
Ordering and duplicates
Section titled “Ordering and duplicates”Duplicates. At-least-once delivery means you can receive the same event more than once, for example if your 2xx was lost on the way back. Store the ids you have processed and ignore an event whose id (the webhook-id header) you have already seen.
Order. Events are not guaranteed to arrive in order: a retry can arrive after a later event. Each event carries the full state, and sequence rises by one with each event of the same request (or conversation). So:
- Keep, for each
data.request.id(ordata.conversation.idforconversation.*), the highestsequenceyou have processed. - If an event arrives with a lower or equal
sequence, it is older: acknowledge it with2xxand ignore it. - Otherwise, replace your copy of the request with the one in the event.
Use the body’s timestamp (when the change happened), not the time you received it, if you need to sort events across different requests.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Answer time | 10 seconds |
| Body size | Under 64 KB. A typical event is 1 to 2 KB |
| Sending rate per endpoint | Up to 10 requests per second and 4 at the same time, by default. Ask us if you need a different limit |
| Retry window | 72 hours |
| Resending a delivery | Up to 30 days after the event |
| Endpoints per account | 10. Each event goes to a single endpoint |
