OrvyxDevelopers

Error codes

Every failure the API can return, with its stable code and HTTP status. Errors are part of the contract, not an afterthought.

The envelope

Success and failure share one shape. On success data carries the payload and error is null; on failure data is null and error carries a stable code plus a human-readable message.

Error envelope
{
  "data": null,
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests. Retry after 30 seconds."
  }
}

The HTTP status mirrors the error: you can read it from the status line, but branch on the code. Statuses can shift as the API evolves; codes do not.

Error codes

CodeHTTPMeaning
RATE_LIMITED429Too many requests in the current window. Retry after the interval in the Retry-After header.
CSRF_ORIGIN_MISMATCH403A browser request arrived from an origin that is not allowlisted for the caller. Server-to-server calls are not affected.
UNAUTHENTICATED401No token was sent, or the token is missing, malformed or expired. Re-authenticate before retrying; retrying as-is will never succeed.
FORBIDDEN403The token is valid, but the caller's role does not permit the operation. Retry with an account that has the required role.
VALIDATION_ERROR422The request body or query parameters failed validation. The message names the field that was rejected.
NOT_FOUND404The resource does not exist, or it exists in a workspace the caller cannot see. The API does not distinguish the two.
BUDGET_EXCEEDED402The workspace has exhausted its AI generation budget for the billing period. Generation resumes when the budget resets or is raised.
PAID_AI_DISABLED503AI generation is temporarily disabled. The platform is up; generation specifically is not. Retry later.
INTERNAL500An unexpected server error. Safe to retry once; if it persists, report it with the request time and route.

Using codes in practice

  • UNAUTHENTICATED means re-authenticate; FORBIDDEN means stop retrying with these credentials. Confusing the two turns a clean failure into a retry storm.
  • RATE_LIMITED is the only error that comes with a server-specified wait; honor Retry-After instead of guessing.
  • BUDGET_EXCEEDED and PAID_AI_DISABLED both mean “not now” for generation, but only the first is under your control — the second is a platform condition.
  • NOT_FOUND never reveals whether a resource exists outside your reach, which is the intended behavior. Treat a surprising 404 as a permissions question first.