Employees API

Manage employee data through the CitoHR API. Access employee information, documents, and leave requests.

Get All Employees

Retrieve a list of employees in your organization.

GET /api/users

Query parameters:

  • departmentId - Filter by department ID (optional)
  • search - Search by name or email (optional)

Authorization: Requires valid session. Returns employees from your organization.

Get Employee by ID

Retrieve details of a specific employee.

GET /api/users/{id}

Returns complete employee information including:

  • Personal information (name, email, phone, image)
  • Roles and status
  • Department and manager information
  • Job history
  • Employee details, emergency contacts, and benefits

Authorization: Requires ADMIN role or manager relationship with the employee.

Get Employee Documents

Retrieve documents for a specific employee.

GET /api/users/{id}/documents

Returns a list of documents associated with the employee.

Get Employee Leave Requests

Retrieve leave requests for a specific employee.

GET /api/users/{id}/leave-requests

Returns all leave requests for the specified employee. Requires ADMIN role or manager relationship.

Get Organization Tree

Retrieve the organizational hierarchy structure.

GET /api/users/organization-tree

Returns the organizational tree structure with all users organized by hierarchy. Useful for building org charts and reporting structures.

Admin Endpoints

The following endpoints require ADMIN role:

  • GET /api/admin/users - Get all users with pagination and filtering
  • POST /api/admin/users - Create a new user
  • GET /api/admin/users/{id} - Get user details
  • POST /api/admin/users/bulk-export - Export users to CSV
  • POST /api/admin/users/bulk-delete - Delete multiple users
  • POST /api/admin/users/bulk-approve - Approve multiple users
  • POST /api/admin/users/bulk-deactivate - Deactivate multiple users