Hermeseus Docs
Legacy docs

Errors

When a request fails, HAPI v3 returns a real HTTP status code and a single, predictable error object. There is never a 200 hiding a failure.

The error object

{
  "error": {
    "type": "invalid_request_error",
    "code": "validation_failed",
    "message": "slices is required.",
    "param": "slices",
    "doc_url": "https://api.hermeseus.com/docs/errors#validation_failed",
    "request_id": "req_z8iukwo8qwf488s01gthblxb"
  }
}
FieldDescription
typeA broad category you can branch on (see below).
codeA specific machine-readable code for the exact problem.
messageA human-readable explanation. Do not match on this string.
paramPresent when one field caused the error; names that field.
doc_urlA link to the relevant documentation.
request_idThe id of this request; quote it to support.

Error types

TypeHTTPMeaning
authentication_error401The token is missing, invalid, or expired.
permission_error403The token lacks a required scope.
invalid_request_error400 / 422The request was malformed or failed validation.
not_found_error404No resource matched.
conflict_error409The request conflicts with current state.
insufficient_balance402The office wallet cannot cover the booking.
rate_limit_error429You are sending requests too quickly.
api_error5xxSomething failed on our side.

Common codes

CodeTypeFix
missing_authorizationauthenticationAdd the Authorization: Bearer header.
invalid_tokenauthenticationThe token is unknown; request a new one.
expired_tokenauthenticationGet a fresh token and retry.
invalid_clientauthenticationCheck the client id and secret.
insufficient_scopepermissionUse a token that holds the scope named in detail.
validation_failedinvalid_requestFix the field named in param; detail lists all issues.
not_foundnot_foundCheck the id in the path.
insufficient_balanceinsufficient_balanceTop up the office wallet, then retry.
rate_limitedrate_limitBack off and retry after a short delay.
internal_errorapiRetry; if it persists, contact support with the request_id.

Handling errors

Branch on type for behaviour and on code for the exact case. Retry 429 and 5xx with exponential backoff; do not blindly retry 4xx other than 429, since the request itself needs to change. Always log the request_id.

Validation detail. A 422 validation_failed carries a detail object mapping each rejected field to its problems, so you can surface every error at once instead of one at a time.