Errors
One envelope, and what each status actually means here.
2 min read
A 4xx comes back in this shape. When the refusal has a reason of its own, message is a code such as roomsNotAvailable — branch on the code, never on prose:
1{2 "message": "No valid API key or JWT token provided",3 "error": "Unauthorized",4 "statusCode": 4015}
Four variations. In a validation error message is an array of strings, one per rule that failed. A 500 carries only statusCode, timestamp and path. A 429 of the rate limiter arrives as plain text: what matters there is the Retry-After-<limit> header. And when a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries fault: dependency means nothing was done and you can retry in a few seconds; outcomeUnknown means it may have been done, so check before repeating it.
1{2 "statusCode": 400,3 "error": "Bad Request",4 "message": [5 "from must be a valid ISO 8601 date string",6 "name should not be empty"7 ]8}
1{2 "statusCode": 409,3 "error": "Conflict",4 "message": "legacyTimeout",5 "fault": "outcomeUnknown"6}
| Status | What it means here |
|---|---|
| 400 | The body or a query parameter failed validation. message names the fields. |
| 401 | Missing, unknown, wrong-property, expired or retired credential, or a partner connection that is not active. Check the pcode before the key. |
| 403 | The credential is valid but was not granted this endpoint — the message names it. For a property’s own key, also: the property has no active API subscription. |
| 404 | No such route, or the record does not belong to that property. |
| 409 | The request conflicts with the current state; message says how — for example roomsNotAvailable (nothing was created) or creationInProgress (a request with the same Idempotency-Key is still running). With fault, a system the API depends on failed instead: dependency (nothing was done; retry in a few seconds) or outcomeUnknown (it may have been done — legacyTimeout, legacyFailed: check before repeating it). |
| 422 | idempotencyKeyReused: that Idempotency-Key was already used with a different body. |
| 429 | Rate limited: 100 requests a minute per source IP, 120 per key and 300 per property, across every endpoint together. Read Retry-After-<limit> (the limit you hit is in the name), stop every request in flight and wait — repeat offences on a key or a property are blocked for longer each time. On the RMS push, a 429 with rmsQueueFull or rmsQueueUnavailable and fault: dependency means the queue is full or did not answer: nothing was stored, resend after the Retry-After seconds. |
| 500 | Our fault, and the only 5xx the API answers. It is already in our error tracker; retry once, then tell support with the timestamp. |
Retry a booking with an Idempotency-Key
Idempotency-Key header when you create bookings: a retry with the same key never creates the booking twice — it answers the same ids once the first request has finished. Without the header, search for the booking before sending it again.