In case of an error, all API responses include a "status" field (of boolean type), an "error" field (of array/object or boolean type) containing a list of errors encountered, and a "message" field for the first error message.

Additionally, the error response codes are passed via the response header.

Lets look at a few common error responses you may encounter.


Sample Error Response

This is the sample format with which error responses look like, irrespective of the nature of the error or response code.


  {
    "status": false,
    "code": 401,
    "errors": [
      "Unauthenticated."
    ],
    "message": "Unauthenticated.",
    "data": null
  }