Skip to main content
The Max AI API uses standard HTTP status codes and returns structured JSON error responses. Every error includes a machine-readable code, a human-readable message, and a trace_id for debugging.

Error Response Format

HTTP Status Codes

Success

Client Errors

Server Errors

Error Examples

400 — Validation Errors

The API returns 400 Bad Request when a required parameter is missing or has an invalid format. The message field tells you exactly which parameter is wrong: Missing required parameter:
Invalid ID format:
In v3, resource IDs use a readable prefixed format (e.g., pat_c56103bcd39c46d39f3138dd2b5e05f6). The API accepts both prefixed IDs and raw UUIDs as path parameters. The X-Organization-Id header still requires a raw UUID.
Invalid header value:
Common causes:
  • A required path or query parameter is missing from the request
  • An ID parameter contains an invalid value (e.g., not-a-uuid instead of a prefixed ID like pat_c56103bcd39c46d39f3138dd2b5e05f6 or a raw UUID like 550e8400-e29b-41d4-a716-446655440000)
  • The X-Organization-Id header is not a valid UUID
  • A comma-separated filter was supplied with no values — ?code= or ?code=, on /bills and /era-service-lines, ?status= on /bills and /claims. This is rejected rather than ignored, because dropping the filter would widen the response to every record in the organization instead of narrowing it. If your cohort is empty, omit the parameter (or skip the request entirely) rather than sending it blank:

401 — Invalid API Key

The message field varies depending on the specific authentication failure (invalid key, revoked key, missing header, etc.).

403 — Insufficient Scope

Returned when your API key is valid but lacks the required scope for the endpoint. The message tells you whether the key itself is missing the scope, or whether the scope is on the key but not granted by the organization’s installation.

404 — Resource Not Found

429 — Rate Limit Exceeded

The response includes headers to help you retry at the right time: See Rate Limits for retry strategies and best practices.

Handling Errors in Code

Debugging

If you encounter an unexpected error:
  1. Check the trace_id in the error response
  2. Verify your API key and Organization ID are correct
  3. Confirm your app has the required scopes for the endpoint
  4. Contact the Max AI team with the trace_id for further investigation