Skip to main content
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

result
array
Array of employee objects

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

v_idEmployee
integer
required
The ID of the employee to update. Must be a positive integer.
v_email
string
required
New email address for the employee. Must be a valid email format.
v_rol
string
required
New role for the employee.Allowed values:
  • Administrador
  • Asistente de Gerencia

Response

mensaje
string
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


Delete Employee

Permanently delete an employee from the system.

Authentication

Requires authentication with the Administrador role.

Request Body

v_idEmployee
integer
required
The ID of the employee to delete. Must be a positive integer.

Response

mensaje
string
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

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

Build docs developers (and LLMs) love