Errors
Every error response has the same shape: a stable code for your program to decide on and a message for a person to read.
The error body
Error
{
"error": "validation_failed",
"message": "O campo name é obrigatório."
}| Field | What it is |
|---|---|
error | The error code, in snake_case. It is stable: decide on it, never on the message text. |
message | The explanation, written in Portuguese, ready to show to a person or write to a log. |
errors | Present in some validation failures: the list of problems found. |
failures | Present on 422: each business rule that blocked the operation. |
traceId | Present in most errors: the request id. Give it to support so the call can be found. |
The statuses
| Status | Default code | When |
|---|---|---|
400 | validation_failed | A body that is not JSON, a missing required field or a value in the wrong format. |
401 | unauthorized | Missing or invalid credentials. |
402 | payment_required | The plan's monthly request quota ran out. |
403 | forbidden | The key is missing the scope, or the plan does not include the feature. |
404 | not_found | The record does not exist in this company. |
409 | conflict | The current state of the record prevents the operation. |
422 | unprocessable | The request is valid, but a business rule blocks it. |
429 | too_many_requests | The requests-per-minute limit was reached. |
5xx | A failure on Guria's side. Try again with increasing waits. |
What is worth retrying
- Retry
429(after the time in theRetry-Afterheader) and5xx, with increasing waits between attempts. - Do not retry
400,401,403,404,409and422without changing the request: the response will be the same. - Be careful when retrying a creation: if the response got lost on the way, the record may have been created. Read before creating again.