Errors
The shape of every error, how to decide by its code and what each code means.
Every error uses the same envelope:
{
"code": "RATE_LIMITED",
"message": "The request limit was exceeded. Try again later.",
"details": [
{ "field": "scope", "message": "O limite por minuto desta chave foi excedido.", "code": "minute" }
],
"requestId": "0197c1d2-8a2e-7f10-9c4b-3e5d6a7b8c90"
}| Field | What it is |
|---|---|
code | Stable error code. Your system decides what to do based on it. |
message | Text for people, in the language asked in Accept-Language: pt-BR (default) or en-US. The text may change, so never compare against it. |
details | Items with field, message and code when the error refers to specific inputs, such as an invalid field. The message of each item is always in Portuguese. |
requestId | Identifier of the call, equal to the X-Request-Id header. |
When you contact support, include the requestId of the call that failed.
Codes
| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_CURSOR | The cursor is invalid. Start the listing over without cursor. |
| 401 | UNAUTHENTICATED | The key is missing, malformed or unknown. |
| 401 | API_KEY_REVOKED | The key was revoked. |
| 401 | API_KEY_EXPIRED | The key is past its expiry. |
| 403 | PERMISSION_DENIED | The key access does not include this operation. |
| 403 | BILLING_FEATURE_REQUIRED | The current plan of the organization does not include the API. |
| 404 | CUSTOMER_NOT_FOUND | The customer does not exist in this organization. |
| 404 | SERVICE_REQUEST_NOT_FOUND | The service request does not exist in this organization. |
| 404 | WORK_ORDER_NOT_FOUND | The work order does not exist in this organization. |
| 404 | SERVICE_LOCATION_NOT_FOUND | The location does not exist or does not belong to the given customer. |
| 404 | ACTIVITY_TYPE_NOT_FOUND | The activity type is not available in this organization. |
| 409 | CUSTOMER_CREATION_IDEMPOTENCY_CONFLICT | The same Idempotency-Key already registered, through the same key, a customer with different data. |
| 409 | IDEMPOTENCY_KEY_REUSED | The same Idempotency-Key already opened a service request with different data. |
| 409 | CUSTOMER_MERGED | The customer was merged into another record and can no longer be changed. |
| 413 | PAYLOAD_TOO_LARGE | The body is larger than 1 MB. |
| 422 | VALIDATION_ERROR | One or more fields or headers are invalid or missing. See details. |
| 422 | INVALID_CUSTOMER | The customer data cannot be accepted. |
| 422 | INVALID_SERVICE_REQUEST | The service request data cannot be accepted. |
| 422 | PAST_DUE_DATE_NOT_ALLOWED | The organization does not accept a due date in the past. |
| 422 | INVALID_COLLECTION_QUERY | A filter is unknown or has a value that does not match the field. |
| 429 | RATE_LIMITED | A rate limit was hit. Wait the time in Retry-After. |
| 500 | INTERNAL_ERROR | Unexpected error. Try again; if it persists, contact support. |
| 503 | RATE_LIMIT_STORE_UNAVAILABLE | The limit control is briefly unavailable. Try again in a few seconds. |
| 503 | SERVICE_UNAVAILABLE | The service is briefly unavailable. Try again in a few seconds. |
A record of another organization answers as if it did not exist. If you get a code that is not on this list, handle the response by its HTTP status.