Skip to main content
The API returns each error with the HTTP status and a body in the RFC 9457 format. The content type is application/problem+json.

Fields

Use the code to decide what your system does. Show the detail to a person.

The language of the explanation

The detail 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_acceptable and the malformed_request of a path or a query that the API cannot read.
The 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

The 422 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 the Idempotency-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

The 400 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/plain in a POST that receives JSON;
  • the address in the Client-IP header is not in the X-Forwarded-For header.

Codes