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:
Show Employee Object Structure
Unique MongoDB identifier for the employee
Personal information about the employee Full name of the employee (max 100 characters)
Email address (unique, lowercase)
National ID or employee identification number (unique)
Employment and role information Employee position. One of: medico, enfermero, auxiliar_enfermeria, administrativo, otro
Department assignment. One of: urgencias, hospitalizacion, consulta_externa, administracion, otro
Employment start date (ISO 8601 format)
Work shift. One of: mañana, tarde, noche, rotativo (default: mañana)
Identifier of the hospital this employee belongs to
Metrics for monitoring employee wellness and burnout risk Show wellnessMetrics fields
Current mood rating (default: 3)
Average workload score (default: 3)
Team support perception score (default: 3)
Job satisfaction score (default: 5)
Burnout risk level. One of: bajo, medio, alto (default: bajo)
Gamification data to encourage platform engagement Total points earned (default: 0)
Current consecutive days streak (default: 0)
Maximum streak achieved (default: 0)
Current level based on points (default: 1)
Array of earned badges Date when badge was earned
Whether the employee is currently active (default: true)
Timestamp when the employee was created
Timestamp when the employee was last updated
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
Query Parameters
Page number for pagination. Default: 1
Number of employees per page. Default: 10
Filter by department. Options: urgencias, hospitalizacion, consulta_externa, administracion, otro
Filter by position. Options: medico, enfermero, auxiliar_enfermeria, administrativo, otro
Response
Indicates if the request was successful
Array of employee objects with selected fields (personalInfo, jobInfo, currentStatus)
Pagination metadata Show pagination properties
Total number of employees matching the query
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
}
}
}