Skip to main content

Error Codes

All API errors return a JSON body with a status and message field:

{
"status": 422,
"message": "Column 'email' cannot be null"
}

2xx — Success

CodeNameWhen you see it
200OKGET / PUT succeeded, response body contains data
201CreatedPOST succeeded, new row inserted
204No ContentDELETE succeeded, no body returned

4xx — Client Errors

CodeNameCommon Cause
400Bad RequestMalformed JSON body or invalid query param format
401UnauthorizedMissing or expired Bearer token
403ForbiddenValid token but insufficient role/permission for this resource
404Not FoundTable or database name does not exist — check /{db}/{table} path
405Method Not AllowedHTTP verb not supported on this endpoint
409ConflictDuplicate entry — unique constraint violation (e.g. email already exists)
422Unprocessable EntityColumn value violates schema constraint (null, type mismatch, length exceeded)
429Too Many RequestsRate limit exceeded — back off and retry after the Retry-After header value

5xx — Server Errors

CodeNameWhat to do
500Internal Server ErrorUnexpected server-side failure — check your request and retry
502Bad GatewayUpstream database unreachable — retry after a short delay
503Service UnavailableServer under maintenance or overloaded — retry with exponential backoff

Header Errors

These are returned as 401 or 403 depending on what is missing:

HeaderMissing → Error
X-Org-Id401 Unauthorized
X-Project-Id401 Unauthorized
X-Space-Id401 Unauthorized
X-User-Id401 Unauthorized
X-User-Roles403 Forbidden — role cannot be resolved

Pagination Errors

ScenarioCodeMessage
ps exceeds 50400"Page size cannot exceed 50"
pg is negative400"Page number must be 0 or greater"
pg beyond total pages200Empty data: [] array — not an error

Example Error Responses

401 — Missing header

{
"status": 401,
"message": "Unauthorized: X-Org-Id header is required"
}

404 — Wrong table name

{
"status": 404,
"message": "Table 'usres' not found in database 'demo_db'"
}

409 — Duplicate email

{
"status": 409,
"message": "Duplicate entry 'alice@example.com' for key 'email'"
}

422 — Schema violation

{
"status": 422,
"message": "Column 'name' cannot be null"
}

429 — Rate limited

{
"status": 429,
"message": "Too many requests. Retry after 30 seconds.",
"retry_after": 30
}