Skip to content

Errors structure

Error message structure

The fields in the table below make up the main structure of the request's return when there is an error.

Field Description Required
slug Identification of the error that represents the business scenario in question. Yes
message Descriptive message of the error that occurred. Yes
details Details of the error that occurred. No

Examples

Error 400 - Bad Resquest

{
   "slug":"BAD_REQUEST",
   "message":"Bad Resquest",
   "details":[
      {
         "field":"name",
         "location":"query",
         "slug":"INVALID_PARAMETER",
         "message":"Invalid parameter"
      }
   ]
}

Error 401 - Unauthorized

{
  "slug": "UNAUTHORIZED",
  "message": "Unauthorized"
}

Error 403 - Forbidden

{
  "slug": "FORBIDDEN",
  "message": "Forbidden"
}

Error 404 - Not Found

{
  "slug": "NOT_FOUND",
  "message": "Not found"
}

Error 409 - Conflict

{
   "slug":"CONFLICT",
   "message":"Conflict",
   "details":[
      {
         "field":"condition",
         "location":"body",
         "slug":"ENTITY_WITH_SAME_KEY_ALREADY_EXISTS",
         "message":"There is already an condition"
      }
   ]
}

Error 422 - Unprocessable Entity

{
   "slug":"UNPROCESSABLE_ENTITY",
   "message":"Unprocessable entity",
   "details":[
      {
         "field":"condition",
         "location":"body",
         "slug":"INVALID_PARAMETER_VALUE",
         "message":"Invalid condition type"
      }
   ]
}

Error 429 - Too Many Requests

{
  "slug": "TOO_MANY_REQUESTS",
  "message": "You have sent too many requests in a given amount of time"
}

Error 500 - Internal Server Error

{
  "slug": "SERVER_ERROR",
  "message": "Internal server error"
}

Error 502 - Bad Gateway

{
  "slug": "BAD_GATEWAY",
  "message": "Bad gateway"
}

Error 503 - Service Unavailable

{
  "slug": "SERVICE_UNAVAILABLE",
  "message": "Service unavailable"
}

Error 504 - Gateway Timeout

{
  "slug": "GATEWAY_TIMEOUT",
  "message": "Gateway timeout"
}