This page documents the employee management endpoints that allow administrators to view, update, and delete employee records.
List All Employees
Retrieve a complete list of all registered employees in the system.
Authentication
Requires authentication with the Administrador role. The access token must be provided in cookies.
Response
Array of employee objects
Unique identifier for the employee
Employee’s role (Administrador or Asistente de Gerencia)
ISO 8601 timestamp of when the employee was created
Request Example
curl -X GET https://api.demet.com/intern/get \
-b "access_token=your_access_token"
Response Example
{
"result": [
{
"id_employee": 4,
"name": "Paula",
"email": "[email protected]",
"rol": "Administrador",
"created_at": "2025-11-18T06:13:41.005Z"
},
{
"id_employee": 5,
"name": "Juan Pérez",
"email": "[email protected]",
"rol": "Asistente de Gerencia",
"created_at": "2025-11-19T10:22:15.123Z"
}
]
}
Update Employee
Update an existing employee’s email and role.
Authentication
Requires authentication with the Administrador role.
Request Body
The ID of the employee to update. Must be a positive integer.
New email address for the employee. Must be a valid email format.
New role for the employee.Allowed values:
Administrador
Asistente de Gerencia
Response
Success message confirming the update
Request Example
curl -X PUT https://api.demet.com/intern/update \
-H "Content-Type: application/json" \
-b "access_token=your_access_token" \
-d '{
"v_idEmployee": 5,
"v_email": "[email protected]",
"v_rol": "Asistente de Gerencia"
}'
Response Example
{
"mensaje": "Update Exitoso"
}
Validation Rules
Show Update Schema Validation
| Field | Type | Validation | Error Message |
|---|
| v_idEmployee | integer | Positive integer | ”Numero debe ser Entero Positivo” |
| v_email | string | Valid email format | ”Email inválido” |
| v_rol | enum | ”Administrador” or “Asistente de Gerencia" | "Rol inválido. Debe ser ‘Administrador’ o ‘Asistente de Gerencia‘“ |
Delete Employee
Permanently delete an employee from the system.
Authentication
Requires authentication with the Administrador role.
Request Body
The ID of the employee to delete. Must be a positive integer.
Response
Success message confirming the deletion
Request Example
curl -X DELETE https://api.demet.com/intern/delete \
-H "Content-Type: application/json" \
-b "access_token=your_access_token" \
-d '{
"v_idEmployee": 5
}'
Response Example
{
"mensaje": "Delete Exitoso"
}
Validation Rules
Show Delete Schema Validation
| Field | Type | Validation | Error Message |
|---|
| v_idEmployee | integer | Positive integer | ”Numero debe ser Entero Positivo” |
Important Notes
Deleting an employee is permanent and cannot be undone. Ensure you have confirmed the deletion before calling this endpoint.
- The deletion is permanent and irreversible
- All data associated with the employee will be removed
- You cannot delete your own account while logged in
- Only administrators can delete employee accounts