ChatBedsDevelopers
Webhooks

Retries and delivery

How ChatBeds sends webhooks, what counts as delivered, the retry schedule, and how to handle repeats and order.

ChatBeds sends each webhook as soon as the booking changes. If your server does not take it, ChatBeds keeps trying for about two days.

What counts as delivered

A delivery succeeds when your server answers with a 2xx status within 10 seconds. Everything else is a failure and is tried again:

  • any other status, including 3xx (redirects are not followed),
  • no answer within 10 seconds, a refused connection, or a TLS error,
  • an address that no longer points at the public internet. The address is checked again before every send.

Answer first and do the work afterwards: put the event on a queue and return 204. Anything slow (calling the API back, sending emails) belongs after the answer.

The retry schedule

A delivery is tried at most 8 times. After a failure, the next try waits at least:

After tryWait
11 minute
25 minutes
330 minutes
42 hours
56 hours
612 hours
724 hours

Retries are sent by a job that runs every hour, so a retry can come up to an hour later than the wait above. After the 8th failure the delivery is given up. Every try is signed again with a fresh timestamp.

A delivery is also given up at once if the key is revoked, the app is disconnected, or the webhook address is removed.

Repeats

You can receive the same delivery more than once: a retry after your server took it but answered too slowly, for example. Each delivery has one ID, the same on every try:

  • the ChatBeds-Delivery header,
  • the id field in the body.

Store the IDs you have handled (a week is plenty) and skip any you have seen.

Order

Deliveries are not guaranteed to arrive in order. A retry of an old event can arrive after a newer one. To keep your copy right:

  • Compare data.reservation.updated_at with what you have, and ignore anything older.
  • Or treat a webhook as a nudge: fetch the booking with GET /reservations/{id} and use what that returns.

Watching deliveries

  • Private keys: Settings → Partner API shows the recent deliveries for each key, with their status and last error.
  • Apps: your app's page in the developer console holds its webhook address. Log the ChatBeds-Delivery ID of every request you receive.

When your server was down

If you were down for longer than the retry schedule covers, some events are gone. Catch up by searching: Keep in sync shows how.

Throughput
Sends at onceUp to 8 deliveries in parallel, across all endpoints
Timeout10 seconds per try
Retries7, over about 2 days

Building something?

On this page