Overview
The Errors section provides information about the error responses returned by the API. It includes details about the error codes, messages, and possible causes.
Format
The API returns errors in the following structure:
| Parameter | Type | Description |
|---|---|---|
|
Number |
The HTTP status code of the error. |
|
String |
The error code that identifies the type of error. |
|
String |
A human-readable message that describes the error. |
|
String |
The timestamp when the error occurred, in ISO 8601 format. |
|
Object / Null |
Additional details about the error, if available. |
For example:
{
"statusCode": 404,
"errorCode": "EMPLOYEE_NOT_FOUND",
"message": "Employee not found: [id=112312]",
"timestamp": "2025-05-02T13:25:21.520037900Z",
"details": null
}
Status Codes
The API uses standard HTTP status codes to indicate the failure of a request. The following table lists the common status codes returned by the API:
| Code | Description |
|---|---|
|
The request was invalid or cannot be served. This can happen if the request body is malformed or missing required parameters. |
|
The request requires authentication. This can happen if the user is not logged in or the provided credentials are invalid. |
|
The request is forbidden. This can happen if the user does not have permission to access the requested resource. |
|
The requested resource was not found. This can happen if the resource ID is invalid or does not exist. |
|
The request could not be completed due to a conflict with the current state of the resource. This can happen if there is a version mismatch or if the resource is already in use. An example of this is when a user tries to create a resource that already exists. |
|
An internal server error occurred. This can happen if there is a bug in the server code or an unexpected condition was encountered. |
Error Codes
The API uses specific error codes to identify the type of error that occurred. The following table lists the possible error codes returned by the API:
| Code | Description |
|---|---|
|
The default approver was not found. This can happen if there are no employees that have the |
|
The email address already exists. This can happen if a user tries to create an employee with an email address that is already in use by another employee. |
|
The employee ID already exists. This can happen if a user tries to create an employee with an ID that is already in use by another employee. |
|
The mobile number already exists. This can happen if a user tries to create an employee with a mobile number that is already in use by another employee. |
|
The employee was not found. This can happen if the employee ID provided does not exist in the system. |
|
The request is forbidden. This can happen if the user does not have permission to access the requested resource. |
|
The CSV file provided is invalid. This can happen if the file format is not correct, if it does not contain the required columns, or if it does not contain valid values. |
|
The request parameter is invalid. This can happen if the parameter value is not in the expected format or if it is missing required values. |
|
The email address provided is invalid. This can happen if the email address is not a valid format or if it does not exist in the system. |
|
The role was not found. This can happen if the role name assigned to an employee does not exist in the system. |
|
The request requires authentication. This can happen if the user is not logged in or the provided credentials are invalid. |
|
An unknown error occurred. This can happen if there is a bug in the server code or an unexpected condition was encountered. |