Skip to content

Error Handling

The server always returns a 200 status code, but any errors are indicated inside the response body. The format for an error response is as follows:

Error Response Format

json
{
    "error": {
        "code": 401,
        "message": "Authorization failed"
    }
}

Successful Response Format

When the request is successful, the response will be inside the response object:

json
{
    "response": {
        // Success data goes here
    }
}

Possible Error Codes

  • 401 Authorization failed. This occurs when the user is not authenticated or lacks permission.
  • 400 Bad request. This includes errors like missing required fields (e.g., "Name is required").
  • 404 Not found. This is returned when a record is not found (e.g., "Department not found").