Status codes
The API uses ordinary HTTP status codes. Anything in the 200s means success.
Status | Meaning | What to do |
|---|---|---|
| It worked. | |
| Something in your request isn't valid, such as a bad date or a | Read the |
| No API key was sent, or the key isn't valid or has been revoked. | Check the |
| The key is valid but doesn't have the permission this request needs. | Create a key with that permission. See Create and manage API keys. |
| There is no such item in your business. | Check the id. An id from another business is treated as not found. A request with a body also gets a |
| The request is fine but can't be done right now: a time that isn't available, a customer email that already exists, a booking that has already started, or a free plan that has used its bookings for the month. | Read the |
| You are sending requests too fast. | Wait for the number of seconds in the |
| Something went wrong on our side. | Try again shortly. If it keeps happening, contact support and quote the id in the message. |
| The API is switched off or unavailable. | Try again later. |
What an error looks like
Errors are JSON in the standard "problem details" shape:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Bad request",
"status": 400,
"detail": "limit must be between 1 and 200.",
"traceId": "00-7efe72488c8c878ded0a97fb2301696e-25e29cccae1da0c6-00"
}detailexplains the problem in plain words. It is written for developers and is safe to log, but not to show to your own customers as it is.traceIdidentifies the request. Quote it if you contact support.
Repeating a request safely
If a request to make a booking or add a customer times out, you can't tell whether it went through. Send it again with an Idempotency-Key header, a unique value you choose for that one action, such as a random UUID:
curl -X POST https://app.bookingly.com/api/v1/bookings \
-H "Authorization: Bearer bkly_live_your_key_here" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2b9e-3d1a-4c55-9b0e-0d6a4f7c1a11" \
-d '{ ... }'If the first request succeeded, sending the same key and the same body again returns the same response, with an Idempotent-Replayed: true header, and nothing is done twice. Things to know:
- Use a new key for each new action. Reusing a key with a different request gives a
409. - Only successful responses are kept, for 24 hours. A request that failed isn't kept, so you can fix it and try again with the same key.
- If you send the same key while the first request is still running, you get a
409. Wait a moment and try again. - Keys are 1 to 100 characters: letters, numbers and
- _ . :.
Idempotency-Key works on POST /v1/customers, POST /v1/bookings and POST /v1/bookings/{id}/cancel.
Rate limits
Each API key can make up to 120 requests a minute. The limit is a sliding window, so it eases off gradually rather than resetting on the minute.
Requests without a valid key are limited far more tightly, by address, which helps protect your account from guessing.
When you go over, you get a 429 with a Retry-After header saying how many seconds to wait. A simple, well-behaved client:
- Stops and waits when it gets a
429. - Waits at least as long as
Retry-Aftersays. - Asks for bigger pages (
limit=200) instead of making many small requests.
If you are reading a lot of data, such as a first import of every customer, page through the list at a steady pace rather than all at once.