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. On every version, the X-Organization-Id header accepts org_… or 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 neither a raw UUID nor anorg_…id - 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.
Insurance and payer error codes
Returned byPOST /v4/patients/{id}/insurance:exact and POST /v4/payers. None of them wrote anything to the EHR.
PATCH /v4/patients/{patientId}/insurance-policies/{policyId} answers 409 policy_update_refused when the EHR did not take the type change: it refused the save (for example, ModMed locks a policy that has claims) or still shows the previous type after it. Retrying will not help; check the policy in the EHR.
GET /v4/payers?patientId= answers 404 patient_not_found when the patient is not in your organization.
GET /v4/payers?newChart=true answers 400 for a primaryFacilityId outside your organization and 503 no_booking_identity when no live system connector can create the chart.
An unknown instanceId is not an error: it returns an empty list.
Referring provider error codes
Returned byPUT /v4/patients/{id}/referring-provider. None of them wrote anything to the EHR.
Prescription error codes
The prescription and pharmacy endpoints (v4, ModMed) return named codes so an app can branch without parsing prose. Codes marked (draft) or (send) come fromPOST /v4/prescriptions, /void and /send; see E-Prescribing.
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
