HTTP Status Codes
Response Envelope
All successful responses use a standard envelope:correlation_id when contacting support.
Error Response Format
All error responses follow a consistent format:Common Error Scenarios
Authentication Errors (401)
/auth/token errors use the envelope {"error":{"code":"UNAUTHORIZED","message":"..."},"timestamp":"..."} (not FastAPI {"detail":"..."}).
Resolution: Get a new token from /auth/token. See Authentication.
Validation Errors (400, 422)
Validation errors return field-level details so you can fix the request without guessing.Optional cases[] count mismatch (422 on /evaluate)
Terms first (also in the Glossary):
record.cases[] is an optional charge map: each row is { court_search_id, offense_id, is_excluded }. Use it when you need to attach your IDs or mark charges excluded. Omit cases or send cases: [] to evaluate every offense — the count gate does not run.
When cases[] is non-empty, the distinct court-search-ID count and total offense-ID row count must exactly match the courts and offenses in the parsed XML or record_json. Partial maps are rejected with HTTP 422 and data.status: "validation_required".
Trigger: Incomplete cases[] — for example 2 court search IDs and 3 offense rows when the record has 3 courts and 5 offenses. Do not drop excluded charges from the array; include them with is_excluded: true.
Do not retry HTTP 422 — fix the payload (complete
cases[] or omit it).cases[] count reconciliation and Glossary → cases.
Partial Success (206)
When a processing stage degrades or fails, the API returns HTTP 206 with partial results:data.status: "partial"data.errors[]— error messages from the failed stagedata.degradation— per-stage statusdata.decision— whatever decisions could still be produced
Server Errors (500)
Related
- Retry Logic — Retry strategy, timeouts, and code examples
- Troubleshooting — Service-specific issues and resolution steps
- API Reference — Endpoint documentation
