API v2 (2.0.0)Guides
Errors
Success
Every success is HTTP 200 in the v2 envelope. profiler is always an empty array.
{ "code": 200, "version": 2, "success": true, "message": null, "data": { "entries": [] }, "profiler": [] }Business errors
A business error keeps the envelope, with HTTP 409, message set to error and the reason in data.data:
{ "code": 409, "version": 2, "success": false, "message": "error", "data": { "data": "No deliveries found" }, "profiler": [] }Each operation in the reference lists its reasons.
Other errors
Authentication, routing and validation errors use a shorter body, with the text in message. The text starts with a space.
| HTTP | When |
|---|---|
| 401 | Authorization missing, or the key does not exist or was deleted |
| 404 | No route matches |
| 405 | Wrong HTTP method for the path |
| 409 | Validation failed: message lists every problem, separated by commas |
{ "code": 409, "success": false, "message": " O campo \"name\" é obrigatório" }