Every response that is not a success has the same body:
{
"error": {
"code": "validation_failed",
"message": "Some fields are not valid.",
"request_id": "6f1c0e1e-8d3b-4c55-9f3a-0b1d2c3e4f5a",
"details": [{ "path": "/name", "code": "maxLength" }]
}
}
What to match on
error.codeis stable: a code is never renamed or removed within a version. Match on it, not on the HTTP status alone.error.details, when present, says what was wrong and where:pathpoints into your request (a JSON pointer such as/name) andcodeis the reason.details[0].codeis the one to branch on, for exampleholder_not_recordedunderforbiddenoridempotency_key_reusedunderconflict.error.messageis for people. It is translated and can change; never parse it.
Common codes
| Status | error.code |
What it means |
|---|---|---|
| 400 | validation_failed |
The request is not valid; details says which field and why |
| 401 | unauthorized |
No key, or a key that is revoked or not valid |
| 403 | forbidden |
The key lacks the scope, or the operation needs a signed-in person |
| 403 | limit_exceeded |
The workspace's plan does not allow it |
| 404 | not_found |
It does not exist, or the key cannot see it |
| 409 | conflict |
It changed, or clashes with something that exists |
| 429 | rate_limited |
Too many requests; wait for Retry-After |
| 5xx | internal_error |
Our side; retry later with backoff |
The full list is in the API reference.
Request IDs
Every response, success or error, carries an x-request-id header, and errors repeat it as error.request_id. Log it with your own records and quote it when you contact us: it lets us find your request quickly.
You can send your own x-request-id (8 to 64 letters, digits, ., _ or -) to tie our logs to yours; otherwise we make one.