Working with the API
Errors and request IDs
The shared error shape, every error type with its HTTP status, and the X-Request-Id header.
Updated
Browse the developer docs
Steps
- Read the
X-Request-Idheader on every response. It isreq_followed by 32 hex characters. Include it when you contact support. - Branch on
error.type, not on the message. Errors have the shape{ "error": { "type", "message", "detail" (optional), "request_id" } }. - Map types to statuses:
invalid_request400,unauthorized401,forbidden403,not_found404,method_not_allowed405,conflict409,idempotency_conflict422,rate_limited429,internal500. - Retry 409, 429 and 500 later. For 429, wait for the
Retry-Afterheader. Fix the request or the credential before you retry a 400, 401, 403, 404, 405 or 422.
Notes
- A path that exists under another method returns 405. An unknown path returns 404 with a message that starts with
"no such resource". - A write body that is not valid JSON returns 400
"request body must be valid JSON". - Unexpected server faults always return type
internalwith the message"internal error"and no details. - A student id that does not exist in your academy returns 404
"no such student". An id that is not a UUID returns 400. - When a tool run under
/v1/fails, the body istools { "error": { "type", "message" } }with typeunknown_tool(404),forbidden(403) orfailed(422).
Related guides
Still need help?
Email hello@chesscore.io. Using ChessCore day to day? Visit the Help centre.