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

statusCode

Number

The HTTP status code of the error.

errorCode

String

The error code that identifies the type of error.

message

String

A human-readable message that describes the error.

timestamp

String

The timestamp when the error occurred, in ISO 8601 format.

details

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

400

The request was invalid or cannot be served. This can happen if the request body is malformed or missing required parameters.

401

The request requires authentication. This can happen if the user is not logged in or the provided credentials are invalid.

403

The request is forbidden. This can happen if the user does not have permission to access the requested resource.

404

The requested resource was not found. This can happen if the resource ID is invalid or does not exist.

409

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.

500

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

DefaultApproverNotFoundException

The default approver was not found. This can happen if there are no employees that have the BENCH_MANAGER or HR role.

EmployeeEmailAlreadyExistsException

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.

EmployeeIdAlreadyExistsException

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.

EmployeeMobileNumberAlreadyExistsException

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.

EmployeeNotFoundException

The employee was not found. This can happen if the employee ID provided does not exist in the system.

ForbiddenException

The request is forbidden. This can happen if the user does not have permission to access the requested resource.

InvalidCsvEmployeeFileException

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.

InvalidRequestParamException

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.

InvalidUserEmailException

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.

RoleNotFoundException

The role was not found. This can happen if the role name assigned to an employee does not exist in the system.

UnauthorizedException

The request requires authentication. This can happen if the user is not logged in or the provided credentials are invalid.

UnknownErrorException

An unknown error occurred. This can happen if there is a bug in the server code or an unexpected condition was encountered.