application/problem+json.
Fields
Use the
code to decide what your system does. Show the detail to a person.
The language of the explanation
Thedetail and the message follow the language that the organization chose in QX: Portuguese (pt-BR) or English (en). The API knows the organization from the key. For that reason, the answers that leave before the key stay in Portuguese:
- the call without a valid key (
401) and the IP address with too many invalid keys (429 too_many_invalid_keys); - the errors that the API answers before it reaches the endpoint, such as
route_not_found,method_not_allowed,not_acceptableand themalformed_requestof a path or a query that the API cannot read.
code, the title and the field names are always in English. A replay with the same Idempotency-Key returns the stored answer in the language of the first call.
Validation error
The422 response with the code validation_failed also has the errors list, with one item for each field with an error. The other 422 codes have one cause only, which the code already names, and they do not have the list.
Request outside the contract
The API checks each request against the OpenAPI specification of this documentation. The check runs after the checks of the key, the subscription, the plan and the call limit. A refused request does not use a paid write. The API does not keep its response for theIdempotency-Key.
The
field of a field inside another field uses a dot, such as recipient.email. A body that is not an object appears as body. The code of the field follows this table:
Some rules do not fit in the contract, such as “send the
contact_id or the tax_id”. The API checks these rules after the contract. So a request with both kinds of error gets the contract errors first.
A call that the API cannot read
The400 response with the code malformed_request tells that the API could not read the call. Examples of causes:
- the path or the query has an invalid encoding;
- the query repeats a parameter in different forms, such as
limit=1&limit[]=2; - the body is not valid JSON;
- the content type is not one of the types that the endpoint accepts, such as
text/plainin aPOSTthat receives JSON; - the address in the
Client-IPheader is not in theX-Forwarded-Forheader.