Errors
On error, success is false, message explains what happened and the HTTP code tells you what to do.
{
"success": false,
"message": "CrΓ©ditos insuficientes.",
"errors": { "balance": 12 }
}- Decide by the HTTP code. It is what tells you the kind of error.
- Show or log the
message. It explains what happened. It comes in Portuguese; field details inerrorsmay come in English. - Read
errorsfor the details. It may be empty, and it may include fields beyond the ones described here (such as a numericstatus_code, which is for support only).
HTTP codes
| HTTP | Meaning | What to do |
|---|---|---|
400 | Malformed request. | Check the JSON you sent. |
401 | Missing, invalid, deleted or expired token. | Check the Authorization header. If the token was deleted, create another one in the panel. |
402 | Not enough balance to generate the keys. | Nothing was charged. errors.balance has your balance; buy credits and try again. |
403 | The token lacks the endpoint's permission, or the key is not yours. | errors.required_scope says the missing permission. Create a token with it. |
404 | Endpoint, product or key not found. | Check the id and the address. |
409 | Idempotency-Key reused for a different request, or the first request is still running. | New request: use a new code. Same request: wait a few seconds and retry. |
422 | Invalid or missing data. | The message says what to fix; on field errors, errors lists them per field. |
429 | Rate limit reached. | Wait the seconds in the Retry-After header and try again. See the limits. |
500 | Error on our side. | Retry with the same Idempotency-Key. If it persists, contact support. |
Field errors (422)
When a field is wrong, errors lists each field with its problems:
{
"success": false,
"message": "Dados invΓ‘lidos.",
"errors": {
"quantity": ["The quantity field must not be greater than 50."]
}
}Retry or not
| Retry | Do not retry |
|---|---|
Network error, timeout, 500 β with the same Idempotency-Key. | 400, 401, 402, 403, 404, 422 β fix it first. |
409 for a request still running β after a few seconds. | 409 for a code used in another request β create a new code. |
429 β after waiting. |