Skip to main content

Introduction

The Employees API allows you to manage healthcare workers in your organization. Each employee record includes personal information, job details, wellness metrics for burnout prevention, and gamification features to encourage engagement.

Employee Schema

The Employee model contains the following main sections:

Available Endpoints

Create Employee

Create a new employee record

Get Employee

Retrieve employee details by ID

Update Employee

Update employee information

List Employees

Get paginated list of employees

Authentication

All employee endpoints require authentication. Include your access token in the Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKEN

Authorization

Some endpoints require admin privileges:
  • Create Employee: Admin only
  • Update Employee: Admin only
  • Get Employee: All authenticated users
  • List Employees: All authenticated users

List All Employees

Retrieve a paginated list of active employees with optional filtering.

Endpoint

GET /api/employees

Query Parameters

page
number
Page number for pagination. Default: 1
limit
number
Number of employees per page. Default: 10
department
string
Filter by department. Options: urgencias, hospitalizacion, consulta_externa, administracion, otro
position
string
Filter by position. Options: medico, enfermero, auxiliar_enfermeria, administrativo, otro

Response

success
boolean
Indicates if the request was successful
data.employees
array
Array of employee objects with selected fields (personalInfo, jobInfo, currentStatus)
data.pagination
object
Pagination metadata

Example Request

curl -X GET 'https://api.example.com/api/employees?page=1&limit=10&department=urgencias' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Example Response

{
  "success": true,
  "message": "Empleados obtenidos exitosamente",
  "data": {
    "employees": [
      {
        "_id": "507f1f77bcf86cd799439011",
        "personalInfo": {
          "name": "Dr. Juan Pérez",
          "email": "[email protected]"
        },
        "jobInfo": {
          "position": "medico",
          "department": "urgencias",
          "shift": "mañana"
        },
        "currentStatus": {
          "isActive": true
        }
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 45,
      "pages": 5
    }
  }
}

Build docs developers (and LLMs) love