Errors
The problem details body every failure returns, how to read it, and how to handle its error codes.
Every failed request returns an RFC 9457 problem details body with Content-Type: application/problem+json:
{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "this company needs its name and billing account before it can be invoiced",
"code": "BOOKING_EXTERNAL_INVOICING_DETAILS_REQUIRED"
}
statusrepeats the HTTP status.codenames the rule that refused the request. Match oncode, never ondetail. A code never changes its meaning or its name.detailexplains the failure to a person. Its wording can change.titleis the HTTP status phrase.
A failure without a specific rule, such as a token without the right role, has no code.
Validation failures
A body, query or path parameter that does not match its schema returns 400 with code VALIDATION_FAILED. issues lists each field that failed, with its path and message:
{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Validation failed",
"code": "VALIDATION_FAILED",
"issues": [{ "code": "invalid_type", "path": ["fromDate"], "message": "Invalid input" }]
}
Status codes
| Status | Meaning | What to do |
|---|---|---|
400 |
The request is not valid, or the current state does not allow it. | Read code. Fix the request or wait for the state to change. |
401 |
The token is missing, expired or not valid. | Get a new token and retry once. |
403 |
The token does not allow this request. | Check the token’s roles. Do not retry. |
404 |
The resource does not exist, or the token cannot see it. | Do not retry. |
409 |
The request conflicts with the resource’s current state. | Read the resource again before you decide. |
429 |
Too many requests. | Wait and retry with backoff. |
5xx |
An unexpected error. | Retry with backoff. |
The API host limits the requests from each IP address per minute: 600 under /v1/booking, 300 under /v1/billing and /v1/crm, and 60 under /v1/integrations. The identity host allows 60 a minute under /oauth. A request over a limit gets 429, and that body is not problem details.
A 429 with a code is problem details, and carries a Retry-After header with the seconds to wait. The billing batch routes answer it with BILLING_BATCH_THROTTLED. See Billing.
Batch results
A batch route under /v1/billing/batch answers 200 with one result per item. A refused item carries the problem details body its single route answers, with the same status and code, inside the 200 response. Handle each one as you would the single route’s failure.
The token endpoint uses its own error format. See Authentication.
Error codes
Each operation in the API reference lists the codes it can return, on the error response of each status. The guide for each part of the API explains the codes you are most likely to meet.
Two rules keep an integration safe when the codes change:
- Handle a code you do not know by its HTTP status. Hydda One can add a code to a route. The table under Status codes says what each status asks of you.
- Not every failure has a code. A
401, a403and most404answers carry none. Handle those by status too.