Error format
All errors return JSON with this structure:Error codes
| Code | HTTP | Meaning | Charged |
|---|---|---|---|
200 | 200 | Successful query | Yes |
payment_missing | 402 | No x402-payment header present | No |
payment_invalid | 402 | Payment verification failed | No |
missing_required_parameter | 400 | Required field absent | No |
invalid_parameter_format | 400 | Field present but malformed | No |
invalid_case_id | 400 | case_id format doesn’t match court | No |
invalid_context | 400 | context not basic or full | No |
invalid_language | 400 | language not en or fr | No |
last_checked_in_future | 400 | last_checked is a future timestamp | No |
invalid_batch_request | 400 | Batch body missing or malformed | No |
case_not_found | 404 | Case not in covered courts | No |
endpoint_not_found | 404 | Unknown endpoint | No |
court_not_covered | 422 | Court not recognized or planned-only | No |
rate_limit_exceeded | 429 | Per-wallet rate limit hit | No |
batch_too_large | 413 | Batch exceeds 50 queries | No |
court_unavailable | 503 | Source court system temporarily unreachable | No |
query_timeout | 504 | Query timed out | No |
internal_error | 500 | Internal server error | No |
Handling errors
Rate limits
| Limit | Value |
|---|---|
| Requests per minute | 60 per wallet |
| Requests per day | 10,000 per wallet |
retry_after value in seconds inside error.details. For portfolios requiring more than 10,000 daily queries, distribute load across multiple funded wallets.
Case not found — auto-scrape
When a 404case_not_found is returned, DocketLayer automatically enqueues the case for its next scrape cycle. Retrying the same query a few minutes later will typically succeed once the normalization service has populated the case.
Source court availability
DocketLayer’s data depends on source court availability. During maintenance windows, affected courts return 503 responses. The/v2/status endpoint reflects known maintenance windows and is the best source for current system state.
Common mistakes
Wrong court code — Use the court code exactly as listed in/v2/status. Common examples: nysd, deb, cand. Do not include .uscourts.gov or any other suffix.
Wrong case ID format — Each court’s expected case ID format is in /v2/status under case_id_format. For US federal courts the pattern is division:year-type-number — e.g. 1:24-cv-01234. See the case ID format guide.
Depleted wallet — A $0 USDC balance causes all queries to return 402. Monitor your wallet balance and refund before it runs dry.
Uncovered court — Querying a court not in the current coverage list returns 422. Always check /v2/status first.
Future last_checked — A last_checked timestamp later than the current time returns 400. This can happen if your system clock is ahead of UTC.