Error Handling

Comprehensive guide to error handling in IXO API

Client Errors (4xx)

Errors that occur due to client-side issues.

Common Errors
  • 400 Bad Request: Malformed request or invalid parameters
  • 401 Unauthorized: Authentication required or failed
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Resource not found
  • 429 Too Many Requests: Rate limit exceeded
Server Errors (5xx)

Errors that occur due to server-side issues.

Common Errors
  • 500 Internal Server Error: Unexpected server condition
  • 502 Bad Gateway: Invalid response from upstream
  • 503 Service Unavailable: Server temporarily unable to handle request

Error Response Structure

IXO API provides informative error responses in JSON format:

{
  "error": {
    "code": 400,
    "message": "Invalid request parameters",
    "details": [
      {
        "field": "entityId",
        "error": "Missing required parameter"
      }
    ]
  }
}

Response Fields

  • code: HTTP status code
  • message: Human-readable error description
  • details: Additional error information

Docs API errors

The /api/* routes on docs.ixo.world answer with JSON, never an HTML page, so an agent can parse the failure without scraping. The envelope extends the structure above with a stable machine-readable code and a resolution hint:

{
  "error": {
    "code": 404,
    "status": "NOT_FOUND",
    "message": "No API route at /api/unknown.",
    "hint": "Available routes: /api/assistant/session, /api/assistant/message, /api/assistant/abort, /api/try.",
    "documentation": "https://docs.ixo.world/api-reference/errors"
  }
}

Envelope fields

FieldTypeMeaning
codeintegerThe HTTP status code, repeated in the body.
statusstringStable machine-readable code. Match on this, not on message.
messagestringWhat went wrong, in one sentence.
hintstringHow to resolve it. Present whenever a resolution exists.
documentationstringURL of the page describing this class of error.

Status codes

BAD_REQUEST · UNAUTHENTICATED · PERMISSION_DENIED · NOT_FOUND · METHOD_NOT_ALLOWED · PAYLOAD_TOO_LARGE · RESOURCE_EXHAUSTED · BAD_GATEWAY · UNAVAILABLE

Rate limits

Every /api/* and /mcp response carries RFC 9331 rate-limit headers, so an agent can pace itself from the published quota:

HeaderExampleSent onMeaning
RateLimit-Policy"mcp";q=120;w=60every responseThe quota (q) per window of w seconds.
RateLimit"mcp";r=0;t=60429 onlyRequests remaining (r) and seconds until the window resets (t).
Retry-After60429 onlySeconds to wait before retrying.

Current quotas: 120 requests per minute per IP on /mcp (policy name mcp), 10 per minute per IP on /api/* (policy name api).

A 429 on /api/* uses the envelope above with status: "RESOURCE_EXHAUSTED"; on /mcp it uses the same HTTP envelope, because the limiter runs before the JSON-RPC layer.

MCP errors

/mcp implements JSON-RPC 2.0, so protocol failures use the JSON-RPC error object rather than the envelope above — there is no status, hint, or documentation field:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": { "code": -32601, "message": "Method not found: tools/invoke" }
}
JSON-RPC codeMeaning
-32700Parse error — the body was not valid JSON.
-32600Invalid request — not a JSON-RPC 2.0 envelope.
-32601Method not found.
-32602Invalid params, including an unknown tool name.

A tool that fails does not produce a JSON-RPC error. It returns a normal result with isError: true and the reason as text content, which is how MCP reports tool-level failures:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{ "type": "text", "text": "No page at /nope. Use search_docs to find the right URL." }],
    "isError": true
  }
}

Transport-level failures before the JSON-RPC layer — a 429 from the rate limiter, or a GET/DELETE on /mcp when no stream is available — use HTTP status codes with the JSON envelope documented above.

Best Practices

Use HTTP Status Codes

Rely on HTTP status codes to understand error types and handle them appropriately.

Implement Retry Logic

For 5xx errors, implement retry logic with exponential backoff.

Validate Input

Validate all input parameters before sending requests to minimize 400 errors.

Respect Rate Limits

Monitor and respect rate limits to avoid 429 errors.

Common Error Solutions

400 Bad Request

Solution: Double-check request syntax and parameters

401 Unauthorized

Solution: Verify access token and re-authenticate if needed

403 Forbidden

Solution: Verify user permissions and roles

500 Internal Server Error

Solution: Retry after delay or contact support