Skip to main content

Errors and codes

Every API v1 error comes back in the same envelope:

{
"message": "Valor original deve ser positivo",
"code": "VALIDATION_ERROR",
"details": { "...": "opcional; ex.: erros de validacao campo a campo" }
}

message is human-readable (and may change); code is stable — program against the code, not the message. Handle any unknown code by its HTTP status.

Codes by HTTP status

400 — invalid request

CodeWhen
VALIDATION_ERRORInvalid body or query; details carries the fields
INVALID_IDID not in UUID format
INVALID_WEBHOOK_URLWebhook URL refused (non-HTTPS or internal network)
INVALID_WEBHOOK_AUTHIncomplete webhook authentication configuration
SSRF_BLOCKEDURL resolves to a blocked destination
INVALID_RECIPIENTInvalid recipient for the notification's channel
INVALID_STATUS_FOR_RESENDNotification in a status that does not allow resending
MISSING_CONTENT_PLACEHOLDEREmail layout without {{content}}
SELF_DEACTIVATION / SELF_ROLE_CHANGEAttempt to deactivate your own account / change your own role
EMAIL_EXISTSEmail already registered

401 — not authenticated

CodeWhen
UNAUTHORIZEDKey missing, invalid, revoked or expired; invalid session

403 — no permission

CodeWhen
FORBIDDENThe actor lacks the required permission
API_KEY_FORBIDDENAPI key attempting an administrative resource or one outside its scope; required indicates the missing permission

404 — not found

CodeWhen
NOT_FOUNDNonexistent resource (or belonging to another organization)
PERSON_NOT_FOUND, CHARGE_NOT_FOUND, CLASSIFICATION_NOT_FOUND, COLLECTION_RULE_NOT_FOUND, STEP_NOT_FOUND, MESSAGE_TEMPLATE_NOT_FOUND, NOTIFICATION_NOT_FOUNDSpecific variants when the route validates a relationship

409 — state conflict

CodeWhen
CONFLICT / DUPLICATERecord conflicts with an existing one (document, name...) or with the current state — e.g. accepting an agreement that is no longer proposed (already accepted or a concurrent acceptance)
USER_EXISTS / INVITATION_EXISTSInvitation for an email that is already a user / already invited
LAST_ADMINDowngrading or deactivating the last administrator
ROLE_IN_USE, RULE_IN_USE, STEP_IN_USE, WORKSPACE_IN_USE, COMPANY_IN_USE, HAS_BRANCHESDeletion blocked: the resource is in use
CHARGE_HAS_RELATED_RECORDSA charge with notifications/interactions/negativations/protests cannot be deleted; details carries the counts
ENDPOINT_INACTIVEWebhook redelivery to an inactive endpoint
IDEMPOTENCY_KEY_REUSEDSame X-Idempotency-Key with a different body
IDEMPOTENCY_REQUEST_IN_PROGRESSConcurrent request with the same key still in flight
NOT_READYResource not ready yet (e.g. export still processing)

410, 413, 422

StatusCodeWhen
410EXPIREDExpired resource (e.g. export download past its deadline)
413FILE_TOO_LARGEImport file above the limit
422DEFAULT_IMMUTABLEThe main workspace / headquarters company cannot be removed
422SYSTEM_ROLE_IMMUTABLESystem roles cannot be edited/deleted

429 and 500

StatusCodeWhen
429RATE_LIMITEDThe key's request limit was exceeded; retry with backoff (details)
500INTERNAL_ERRORUnexpected server failure; retry with the same X-Idempotency-Key

Handling recipe

  • 4xx except 409/429: your mistake; fix the request before repeating.
  • 409: read the code; it is almost always a business rule protecting state (retrying does not fix it).
  • 429 and 5xx: retry with exponential backoff and the same idempotency key — idempotency guarantees nothing executes twice.