Skip to main content

Response Format

All API responses use a consistent JSON envelope.

Success Responses

{
"success": true,
"data": {
"id": "case_abc123",
"name": "Smith v. Johnson",
"plaintiff_name": "John Smith"
}
}
FieldTypeDescription
successbooleantrue for successful requests
dataobjectThe response payload — structure varies by endpoint

Error Responses

{
"success": false,
"error": "case_id is required",
"error_code": "case_id_missing",
"error_type": "invalid_request_error",
"request_id": "req_abc123"
}
FieldTypeDescription
successbooleanfalse for error responses
errorstringHuman-readable error message
error_codestringMachine-readable error code — switch on this
error_typestringError category for generic handling
error_paramstringPresent when the error relates to a specific field
request_idstringUnique ID for debugging with support

See Error Handling for the full error code catalog.

Parsing Responses

resp = requests.post(f"{BASE_URL}/api/cases", headers=headers, json=body)
result = resp.json()

if result["success"]:
case_id = result["data"]["case"]["id"]
print(f"Created case: {case_id}")
else:
print(f"Error: {result['error']} ({result['error_code']})")

Field Naming

All field names use snake_case:

{
"case_id": "case_abc123",
"plaintiff_name": "John Smith",
"file_category": "vehicle_photo",
"vehicle_role": "plaintiff",
"created_at": "2024-01-10T14:30:00Z"
}

List Responses

List endpoints return an array in the data field:

{
"success": true,
"data": {
"cases": [
{ "id": "case_abc123", "name": "Smith v. Johnson" },
{ "id": "case_def456", "name": "Doe v. Williams" }
]
}
}

Request IDs

Every response includes a request_id (also in the X-Request-ID header). Include this when contacting support.

You can send your own X-Request-ID header for tracing — the API will use it as-is and echo it back.