Skip to main content

Errors

Error response format and the status codes the API returns.

When a request fails, the API returns a non-2xx status code and a JSON body with an error field describing the problem.

{
  "error": "Forbidden - Admin access required"
}

Successful responses instead carry "success": true and a data payload (legacy endpoints), or the resource / { data, pagination } envelope (/api/v1).

Error shapes

The legacy endpoints return a human-readable { "error": "..." } message. The /api/v1 endpoints return a stable machine code in error, optionally with a message and extra fields:

{ "error": "insufficient_scope", "message": "This API key is missing required scope(s): candidates:read.", "requiredScopes": ["candidates:read"], "grantedScopes": ["roles:read"] }
{ "error": "bad_request", "message": "Invalid field(s)", "details": ["status must be a non-empty string"] }

/api/v1 machine codes: bad_request (400), insufficient_scope (403), forbidden (403), not_found (404), internal_error (500). On insufficient_scope, read requiredScopes / grantedScopes to self-correct.

Status codes

StatusMeaningWhat to do
200SuccessRead the response body.
201CreatedA POST created the resource; read it from the body.
204No contentA DELETE succeeded; there is no body.
400Validation errorFix the request body or parameters; error/details say what is wrong.
401UnauthorizedNo valid API key was supplied. Check the Authorization header.
403Forbidden / insufficient scopeThe key’s owner lacks the required role, or the key is missing the required /api/v1 scope (insufficient_scope).
404Not foundThe resource does not exist — or, on /api/v1, exists but is not visible to the key (no existence leak).
429Rate limitedHonor the Retry-After header and back off.
500Server errorTransient — retry with backoff; if it persists, contact support.

Common error messages

EndpointMessageCause
Create keyName is requiredMissing name in the body.
Create keyuserId is requiredMissing userId in the body.
Create keyexpiresInDays must be between 1 and 365Out-of-range expiry.
Create keyTarget user not founduserId does not match a user.
Revoke / usageKey not foundThe id does not match a key.
AnyUnauthorizedMissing or invalid key.
Any (admin)Forbidden - Admin access requiredKey owner is not an admin.