Errors

Relay uses conventional HTTP status codes and returns a consistent JSON error envelope so you can handle failures programmatically.

Error envelope

Every error response has a single error object with a machine-readable type, a code (mirrors type by default), and a human-readable message:

Error response
{
  "error": {
    "type": "validation_error",
    "code": "validation_error",
    "message": "identity has invalid characters"
  }
}

Common error types

TypeStatusDescription
unauthorized401The API key is missing or invalid.
key_revoked401The API key was valid but has been revoked.
forbidden403The key is valid but not permitted to perform this action.
not_found404The requested resource does not exist.
invalid_request400 / 422The request was malformed — for example a body that is not valid JSON, or a request that could not be fulfilled.
validation_error422The request body failed schema validation.
rate_limited429The API key exceeded its rate limit. Inspect the RateLimit-* headers and retry after the Retry-After delay.
quota_exceeded402The organization's monthly participant-minute quota for its plan has been reached. Returned by POST /v1/tokens and POST /v1/rooms.