Skip to main content

Employees API

The Employees module manages your workforce — personal details, department assignments, job positions, and employment contracts. It integrates with Attendance, Payroll, Time Off, and Appraisals modules.


Endpoints

MethodPathDescription
GET/api/employeesList employees (paginated)
POST/api/employeesCreate an employee
GET/api/employees/:idGet an employee
PATCH/api/employees/:idUpdate an employee
DELETE/api/employees/:idArchive an employee
GET/api/employees/departmentsList departments
POST/api/employees/departmentsCreate a department
GET/api/employees/:id/contractsList contracts for an employee
POST/api/employees/:id/contractsAdd a contract
GET/api/employees/:id/time-offList approved leave
GET/api/employees/:id/attendanceList attendance records

List Employees

GET /api/employees?page=1&limit=20&department=engineering&status=active&search=john

Query Parameters

ParameterTypeDescription
pagenumberPage number
limitnumberItems per page (max: 100)
searchstringSearch by name or job title
departmentstringFilter by department name or ID
statusactive | archivedEmployment status (default: active)
sortBystringname, department, hireDate

Response

{
"data": [
{
"id": "018ecccc-abcd-7000-8000-000000000001",
"name": "Jane Smith",
"email": "[email protected]",
"jobTitle": "Senior Developer",
"department": {
"id": "018ecccc-dddd-7000-8000-000000000001",
"name": "Engineering"
},
"manager": {
"id": "018ecccc-eeee-7000-8000-000000000001",
"name": "Bob Johnson"
},
"hireDate": "2024-03-01",
"status": "active",
"createdAt": "2024-03-01T08:00:00Z"
}
],
"meta": { "total": 45, "page": 1, "limit": 20, "totalPages": 3 }
}

Create an Employee

POST /api/employees
Content-Type: application/json
Authorization: Bearer eco_live_...

Request Body

{
"name": "Alice Wong",
"email": "[email protected]",
"jobTitle": "Product Manager",
"departmentId": "018ecccc-dddd-7000-8000-000000000001",
"managerId": "018ecccc-eeee-7000-8000-000000000001",
"hireDate": "2026-04-01",
"phone": "+1-555-333-4444",
"address": {
"city": "New York",
"country": "US"
}
}

Required fields: name, email, jobTitle, hireDate


Departments

List Departments

GET /api/employees/departments
[
{
"id": "018ecccc-dddd-7000-8000-000000000001",
"name": "Engineering",
"manager": { "id": "...", "name": "Bob Johnson" },
"employeeCount": 12
}
]

Create a Department

POST /api/employees/departments
Content-Type: application/json

{
"name": "Customer Success",
"managerId": "018ecccc-abcd-7000-8000-000000000001"
}

Contracts

List Contracts

GET /api/employees/018ecccc-abcd-7000-8000-000000000001/contracts
[
{
"id": "018ecccc-ffff-7000-8000-000000000001",
"type": "full_time",
"startDate": "2024-03-01",
"endDate": null,
"salary": 8500000,
"currency": "usd",
"status": "active"
}
]

Note: salary is in smallest currency unit (cents).

Add a Contract

POST /api/employees/018ecccc-abcd-7000-8000-000000000001/contracts
Content-Type: application/json

{
"type": "full_time",
"startDate": "2026-04-01",
"salary": 9000000,
"currency": "usd"
}

Contract types: full_time, part_time, contractor, intern


Status Codes

CodeScenario
200Get or list succeeded
201Employee, department, or contract created
204Employee archived
404Employee or department not found
409Email already used by another employee
422Validation failure (e.g., invalid hire date)