Error Codes

HTTP status codes and error response format.

Error Response Format

Every error returns JSON. The same request ID is also sent in the X-Request-ID response header:

{
  "error": {
    "code": "CONFLICT",
    "message": "Insufficient balance"
  },
  "request_id": "6bfe7ba7-7b31-4bd4-bf7d-6a783cf5a3a3"
}

Status Codes

CodeMeaning
200Success
201Created (for example, a new user or figure submission)
400Bad Request — invalid parameters
401Unauthorized — missing or expired token/API key
403Forbidden — not your resource (e.g. canceling another user's order)
404Not Found — asset or resource doesn't exist
409Conflict — concurrent state change, duplicate claim, or finalized order
429Too Many Requests — endpoint-specific rate limit exceeded
500Internal Server Error — unexpected failure
503Service Unavailable — required database/cache state is temporarily unavailable

Common Error Messages

  • "Invalid token" — JWT expired or malformed. Refresh your token via /auth/refresh.
  • "Insufficient balance" — Not enough OPS for the order.
  • "Username already exists" — Registration conflict.
  • "Order not found" — Invalid order ID for cancel.
  • "Not your order" — Attempting to cancel another user's order.
  • "Asset not found" — Invalid asset ID.