Introduction
With the Bookingmood API you can access and manage your data in a programmatic way, using HTTP requests. The structure of the Bookingmood API is based on PostgREST v14.
Base URL
All endpoints are relative to https://api.bookingmood.com/v1. Every request must be authenticated with an API key, which scopes all data to its organization.
OpenAPI spec
The whole API, including the booking flow, is described in an OpenAPI 3.0 spec with request and response schemas. Import it into tools like Postman or Insomnia, or use it to generate a typed client.
Requests
Each core resource supports some or all of the following methods:
GET /{resource}lists records. Use selecting, filtering and sorting & pagination to shape the result.POST /{resource}creates one record, or several when the body is an array.PATCH /{resource}updates all records matching the filters.DELETE /{resource}deletes all records matching the filters.
Request bodies are JSON, sent with the Content-Type: application/json header. Updates and deletes without filters apply to every record you have access to, so always filter, for example on id=eq.{id}.
When you change the status or unit of calendar events, or delete them, Bookingmood plans the booking's scheduled messages and tasks again, within a couple of minutes. Guests aren't emailed about a new status unless you send the header X-Notify-Guests: true. Then the guest gets the unit's "Booking confirmed", "Booking cancelled" or "Booking changed to pending" message, as when you change the status in Bookingmood.
Responses
Responses are JSON. By default the API sends Prefer: count=exact, return=representation to PostgREST, so:
Creates, updates and deletes return the affected records.
List responses include a
Content-Rangeheader with the returned range and the total number of matching records, for example0-9/42.
To change this, send your own Prefer header. For example, Prefer: return=minimal returns 204 No Content for updates and deletes.
Errors
The API uses conventional HTTP status codes:
400The request is malformed, for example an unknown column, an invalid filter, or a body that doesn't match the endpoint's schema.401The API key is missing or invalid.403The API key has no permission for this record.405The resource does not exist, or the method is not available for it.409The request conflicts with existing data, for example a duplicate key.429The API key made more requests than its rate limit allows.5xxSomething went wrong on our side.
Errors have a JSON body following the PostgREST error format, with a code, message, details and hint. When a request doesn't match an endpoint's schema, for example on the booking flow endpoints, the code is BM400 and details lists each invalid field. Every request, including failed ones, is logged and can be inspected through the API requests resource.
Rate limits
Each API key may make 120 requests per minute, counted over a sliding window of the last 60 seconds. Every response says where the key stands:
RateLimit-PolicyThe limit and window, for example"default";q=120;w=60.RateLimitThe requests remaining and the seconds until more become available, for example"default";r=87;t=23.X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-ResetThe same values, for clients that read these headers.
Requests over the limit get a 429 Too Many Requests response with a Retry-After header: wait that many seconds before retrying, and back off further on repeated 429s rather than retrying in a tight loop. Rejected requests don't count towards the limit, and show up in the key's usage and in API requests with status 429.
To stay well within the limit, paginate large lists instead of fetching everything at once, embed related resources instead of fetching them one by one, use webhooks instead of polling, and spread scheduled syncs out rather than starting them all at once. The settings of each API key show its limit and current usage. If your integration needs more, request a higher limit from there.
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Range: 0-9/42{
"code": "PGRST204",
"details": null,
"hint": null,
"message": "Could not find the 'nme' column of 'products' in the schema cache"
}