Errors

On error, success is false, message explains what happened and the HTTP code tells you what to do.

Example β€” not enough balance (402)
{
  "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 in errors may come in English.
  • Read errors for the details. It may be empty, and it may include fields beyond the ones described here (such as a numeric status_code, which is for support only).

HTTP codes

HTTPMeaningWhat to do
400Malformed request.Check the JSON you sent.
401Missing, invalid, deleted or expired token.Check the Authorization header. If the token was deleted, create another one in the panel.
402Not enough balance to generate the keys.Nothing was charged. errors.balance has your balance; buy credits and try again.
403The token lacks the endpoint's permission, or the key is not yours.errors.required_scope says the missing permission. Create a token with it.
404Endpoint, product or key not found.Check the id and the address.
409Idempotency-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.
422Invalid or missing data.The message says what to fix; on field errors, errors lists them per field.
429Rate limit reached.Wait the seconds in the Retry-After header and try again. See the limits.
500Error 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

RetryDo 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.

On this page