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 returns400 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:
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.- A required path or query parameter is missing from the request
- An ID parameter contains an invalid value (e.g.,
not-a-uuidinstead of a prefixed ID likepat_c56103bcd39c46d39f3138dd2b5e05f6or a raw UUID like550e8400-e29b-41d4-a716-446655440000) - The
X-Organization-Idheader is not a valid UUID - A comma-separated filter was supplied with no values —
?code=or?code=,on/billsand/era-service-lines,?status=on/billsand/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
Themessage 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. Themessage 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
See Rate Limits for retry strategies and best practices.
Handling Errors in Code
Debugging
If you encounter an unexpected error:- Check the
trace_idin the error response - Verify your API key and Organization ID are correct
- Confirm your app has the required scopes for the endpoint
- Contact the Max AI team with the
trace_idfor further investigation
