Skip to main content
Every error uses an HTTP status and the same JSON body:
422 Unprocessable Entity
The Request-Id response header carries the same id on every response, successful or not. Log it.

Types and statuses

New types and codes can appear. Handle an unknown code by its type and HTTP status.

Every problem at once

POST /v1/quotes checks the whole body and reports every problem in one 422, so you can fix them all before trying again. Each entry in details has its own code, a param pointing at the field, and a message you can show a user next to that field. param and message are the stable parts; detail codes such as REQUIRED, INVALID_TYPE, INVALID_FORMAT, UNKNOWN_FIELD, UNKNOWN_VALUE and OUT_OF_RANGE help you group them, and new ones can be added. Unknown fields are always rejected, with a “did you mean” when one is close. That catches a misspelled field before it silently does nothing. The insured’s state is a common one. insured.address.state must be a two-letter USPS state code (the 50 states, DC, PR, GU, VI, AS or MP). Anything else is an INVALID_FORMAT detail: a full state name gets Use the two-letter state code, e.g. "TX" for Texas., and any other value gets Must be a two-letter US state code, e.g. "TX".

Not an error: an ineligible deal

A deal we can’t finance is a successful 201 quote with eligibility.status: "ineligible", its reasons and no options. A 422 means only that the request itself was malformed. For example, a valid state code outside Texas, such as OK, gets a 201 ineligible quote, while Oklahoma gets a 422. See eligibility.

Ids you can’t see are 404

A malformed id, a quote from another agency, a quote in the other mode, and a colleague’s quote read with a broker key all return the same 404 NOT_FOUND. An id never reveals whether a deal exists outside what your key can see.

Handling errors in code

For the full list, with what causes each code and what to do, see error codes.