Skip to main content

Employees API

Endpoints for managing employee records in IceHrm.

List Employees

Retrieves a list of employees. Admin users see all employees; managers see only their subordinates.

GET /employees/?page={page}&limit={limit}

Parameters:

  • page (optional): Page number, default 1
  • limit (optional): Number of records per page

Response: 200 OK

{
"status": "SUCCESS",
"data": [
{
"id": "1",
"employee_id": "EMP001",
"first_name": "John",
"last_name": "Doe",
"nationality": "American",
"job_title": "Software Engineer"
}
],
"nextPage": 2
}

Get Current User Profile

Retrieves the employee profile of the authenticated user.

GET /employees/me

Response: 200 OK

{
"status": "SUCCESS",
"data": {
"id": "1",
"employee_id": "EMP001",
"first_name": "John",
"last_name": "Doe",
"nationality": "American",
"job_title": "Software Engineer",
"department": {
"id": "1",
"name": "Engineering"
},
"supervisor": {
"id": "2",
"name": "Jane Smith"
}
}
}

Get Single Employee

Retrieves a specific employee by ID. Admin users can access all employees; non-admin users need ownership or supervisor relationship.

GET /employees/{id}

Response: 200 OK or 404 Not Found

{
"status": "SUCCESS",
"data": {
"id": "1",
"employee_id": "EMP001",
"first_name": "John",
"last_name": "Doe"
}
}

Create Employee

Creates a new employee record. Admin users only.

POST /employees/

Request Body:

{
"employee_id": "EMP002",
"first_name": "Jane",
"last_name": "Smith",
"nationality": "Canadian",
"job_title": "Product Manager"
}

Response: 201 Created

{
"status": "SUCCESS",
"data": {
"id": "2",
"employee_id": "EMP002",
"first_name": "Jane",
"last_name": "Smith",
"nationality": "Canadian",
"job_title": "Product Manager"
}
}

Update Employee

Updates an existing employee record. Same access restrictions as Get Single Employee.

PUT /employees/{id}

Request Body:

{
"job_title": "Senior Product Manager"
}

Response: 201 Created with updated record and Location header

Delete Employee

Deletes an employee record. Admin users only.

DELETE /employees/{id}

Response: 200 OK

{
"status": "SUCCESS",
"data": {
"id": "2"
}
}

Get Employee Education

Retrieves education records for a specific employee.

GET /employees/{id}/educations

Response: 200 OK

{
"status": "SUCCESS",
"data": [
{
"id": "1",
"education_id": "1",
"institute": "MIT",
"date_start": "2010-09-01",
"date_end": "2014-06-01"
}
]
}

Get Employee Languages

Retrieves language proficiency records for a specific employee.

GET /employees/{id}/languages

Response: 200 OK

{
"status": "SUCCESS",
"data": [
{
"id": "1",
"language_id": "1",
"reading": "Expert",
"speaking": "Expert",
"writing": "Advanced",
"understanding": "Expert"
}
]
}