Error Responses Format
Error Responses provide information about why an API request failed, including HTTP status codes and error messages.
404 Not Found
{
  "success": false,
  "message": "Contact not found",
  "errors": {
    "code": 404,
    "id": "999999"
  },
  "docs": "http://localhost/ialharami-com/api/v1/docs"
}
            
In the example above, the contact was not found because of the specific ID (shown in the errors key). Similarly, if there is a pagination issue, the page number will appear in the errors keys.
422 Validation
{
  "success": false,
  "message": "Validation Error",
  "errors": {
    "code": 422,
    "details": {
      "phone": [
        "The phone field is required."
      ],
      "email": [
        "The email field is required."
      ]
    }
  },
  "docs": "http://localhost/ialharami-com/api/v1/docs"
}
            
The details key contains the validation errors and can include one or more fields.
500 Internal Server Error
{
  "success": false,
  "message": "Internal server error",
  "errors": {
    "code": 500,
    "detail": "Method ... show does not exist."
  },
  "docs": "http://localhost/ialharami-com/api/v1/docs"
}