Errors
Every refusal is an RFC 9457 problem, sent as
application/problem+json:
Code
Code against type, never detail: the detail is for people and may change. Each type is a page
here that says what it means and what to do.
| Status | Type |
|---|---|
| 400 | invalid-body, unknown-include, unsupported-locale, invalid-lead |
| 401 | unauthorized |
| 403 | institution-inactive, network-not-allowed, insufficient-scope, api-access-off, not-licensed, lead-capture-off |
| 404 | unknown-calculator, unknown-lead |
| 409 | consent-not-current |
| 413 | body-too-large |
| 422 | invalid-inputs: the calculator refused the inputs, and errors lists each one with a JSON Pointer to it, and a hint where one helps. For a lead: idempotency-key-reused. |
| 429 | rate-limited, quota-exhausted, too-many-failed-keys |
| 503 | unavailable, busy |
A 429 or 503 carries Retry-After, in seconds. Wait at least that long; retrying sooner only spends
your rate limit.
Reading a refusal's body
Some HTTP clients treat a 4xx as an exception and keep the body out of sight, and the body is what says
what to fix. In Windows PowerShell 5.1, Invoke-RestMethod and Invoke-WebRequest throw on a 4xx: read
the problem from the error record, $_.ErrorDetails.Message, in a catch block. PowerShell 7 can keep
the answer instead, with -SkipHttpErrorCheck and -StatusCodeVariable:
Code
curl prints the body whatever the status; add --fail-with-body to make it fail the command too.