Error format
Errors return JSON with adetail field.
On the metered routes the body also carries a stable code, a requestId and a retryable flag:
code, not on the text of detail.
Quote requestId when you contact support.
Every code is listed in the error code reference.
Validation errors (422) keep detail as a short string and put the field-level details in errors:
detail for the message and errors[].loc to find the field.
Error body edge cases
Error body edge cases
The
401 text says which of three things is wrong: no key was sent, the key does not start with vq_key_, or the key is unknown, revoked or expired.Every 404 and 405 carries code and requestId, including a path that does not exist.Some validation errors carry extra keys on each entry, such as ctx for a failed rule.
A 422 from a rule that spans several fields (chapter without titleNumber, a malformed Boolean expression) is a plain detail string with no errors array, as is every other error status.Status codes
Each row links to the error code reference, which is the per-code detail.
A
429 has three meanings, told apart by code.
rate_limited is retryable.
quota_exceeded is a standing account limit such as the watch cap (see Law change alerts), and retryable: false, because waiting does not help: delete a watch or upgrade.
daily_cap_exceeded is the per-key daily cap.
The cooldown 429 on a watch test delivery sends Retry-After: 30.
402 body
A402 adds the numbers behind the refusal when they are known:
GET /credits/balance is free and shows your current balance.
400 versus 422
A422 is schema validation: a field is missing, or its type or range is wrong.
The API rejects it before your request reaches any business logic, and the response carries the loc array shown above.
A 400 is a request that is well-formed but not allowed.
GET and POST /us/statutes/resolve answer a corpusType or state scope they do not accept with a 422 (code invalid_citation_input) before any charge, so nothing is charged or refunded.
POST /watches and PATCH /watches/{id} return it for:
- a
scopethe board cannot be narrowed by, or anactIdscope that does not exist on that board, - a source that is not scopable at all, meaning a board whose
scopableisfalsesuch as the Federal Register, - a missing
webhookUrloremailAddressfor thechannelyou asked for, or one set on a channel that does not use it, - a
webhookUrlthe API refuses as a delivery target, - a
webhookAuth.headerNamethat is not a legal header name, or outbound auth set on an email-only watch.
detail string names the specific problem, so read it rather than retrying.
409 on watches
POST /watches returns 409 when you already hold a watch on the same board, the same channel, and the same scope.
Watches are unique on that triple, so a 409 means the subscription already exists. Nothing has failed.
PATCH /watches/{id} returns it for the same reason, when narrowing a watch’s scope would collide with another watch you already hold.
List your watches with GET /watches and reuse the existing one.
Rate limiting
Limits are enforced per API key and scale with your plan. A valid key has its own bucket at your plan limit, so other callers behind the same IP address do not use it up. A per-address backstop at 10 times that limit also applies. A key that does not validate is counted in the shared per-address bucket instead. Every response carriesX-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (a Unix timestamp) for the per-minute window.
It also carries X-RateLimit-Limit-Hour and X-RateLimit-Remaining-Hour for the hourly window.
X-RateLimit-Limit-Day, X-RateLimit-Remaining-Day and X-RateLimit-Reset-Day (the next UTC midnight, as a Unix timestamp) describe the daily one.
On a request with an API key, X-RateLimit-Scope is key when the numbers describe your key’s own bucket and ip when they describe the shared per-address bucket.
It is absent on requests without an API key.
Browsers can read all of these headers on cross-origin calls.
When you exceed one the API returns 429.
A 429 or 503 that sends a Retry-After header also carries retryAfterSeconds in the error body.
Both are whole seconds, and for a rate limit they count down to the end of the window that refused you.
Wait that long, then retry the same request.
If there is no hint, retry with exponential backoff.
daily_cap_exceeded is also a 429, but retrying cannot succeed until the cap resets.
The official SDKs already retry the safe cases for you.
If you call the API directly, add exponential backoff so retries spread out under sustained pressure.
Retry loop example
Retry loop example
Related
Error code reference
Every machine-readable code, with its status, retry rule and SDK class.
SDKs
The official SDKs map these errors to typed exceptions and retry the safe ones for you.

