Skip to content

Errors

Every error — whether produced by the service or by the API gateway in front of it — returns the same JSON envelope:

{
"error": {
"code": "validation_error",
"message": "Human-readable explanation of what went wrong.",
"request_id": "5f3e1c2a-…"
}
}
FieldTypeDescription
codestringStable, machine-readable error code. Branch on this, not on message.
messagestringHuman-readable explanation, safe to log or surface to operators.
request_idstringUnique ID for this request. Quote it when reporting a problem.
detailsarrayOnly present on validation_error — one entry per offending field (see below).
StatuscodeMeaning
400invalid_jsonRequest body is not valid JSON. The message pinpoints the line and column where parsing failed.
403INVALID_API_KEY / ACCESS_DENIEDMissing or invalid x-api-key header (generated by the gateway).
404not_foundUnknown path. The message lists the available endpoints.
405method_not_allowedMethod other than POST.
422validation_errorBody failed validation — missing field, empty list, title too long, batch too large. See details.
429THROTTLED / QUOTA_EXCEEDEDRate limit or daily quota exceeded (generated by the gateway). Back off and retry.
500internal_errorUnexpected service failure. Retry once; if it persists, report the request_id.

Gateway-generated codes (403, 429) are upper-case API Gateway response types; service-generated codes are lower-case. Treat any code you don’t recognise as non-retryable except 429 and 500.

{
"error": {
"code": "validation_error",
"message": "Request body failed validation (titles[41]). See details.",
"request_id": "5f3e1c2a-…",
"details": [
{
"field": "titles[41]",
"issue": "String should have at most 300 characters",
"type": "string_too_long"
}
]
}
}

field identifies the offending input — for batch requests it includes the item index (titles[41]), so you can fix or drop just that item and resubmit.