Reference

Errors

Status codes and the shape of error responses.

StatusWhen
400CNPJ with invalid format or check digits; in search, an invalid limit or cursor.
404Valid CNPJ, but not in the database.
429Paginated search: server limit reached.
502No provider answered. The body carries each error.

Shape

// v2
{ "error": "Invalid CNPJ: use 12 alphanumeric characters + 2 check digits." }

// v1
{ "detail": "Invalid CNPJ: use 12 alphanumeric characters + 2 check digits." }

502 error

{
  "message": "Falha ao consultar CNPJ em ambas as fontes.",
  "minhareceita_error": "HTTP 500 ao consultar minhareceita.org",
  "receitaws_error": "HTTP 429 ao consultar receitaws.com.br"
}