Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/MultiSas/llms.txt

Use this file to discover all available pages before exploring further.

The employee endpoints manage the staff records attached to a company in the sublimation module. Employees can be assigned to production jobs and are referenced in payroll rosters. Each employee record tracks contract type, document information, and employment status.
All employee endpoints require TokenAny plus TokenAuthorize('Admin', 'Super Admin'). Pass your token using token-access: Bearer $TOKEN.

POST /api/employee/create/:company_id

Creates a new employee record for the specified company. The stade_employee field is automatically set to "Inactivo" on creation and cannot be provided in the request body. Path parameters
company_id
string
required
MongoDB ObjectId of the company the employee belongs to.
Body parameters
name_employee
string
required
Full name of the employee.
type_document_employee
string
Document type (e.g., CC for Cédula de Ciudadanía, PP for Pasaporte, EXT for Extranjero).
number_document_employee
number
Document number.
base_saraly_employee
number
Base salary. Note: the field name contains a typo (saraly instead of salary) — this matches the source schema exactly and must be used as-is.
type_contract_employee
string
Contract type. Accepted values: Fijo, Indefinido, Prestaciones.
type_employee
string
Employee role within the company (e.g., Diseñador, Operador, Vendedor).
Response
msj
string
"Empleado creado correctamente" on success.
status
boolean
true on success.
save_employee
object
The created employee document including _id, all submitted fields, stade_employee ("Inactivo"), company, createdAt, and updatedAt.
curl -X POST https://api.example.com/api/employee/create/64a1f2e3b5c8d90012345678 \
  -H "token-access: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name_employee": "María Torres",
    "type_document_employee": "CC",
    "number_document_employee": 1098765432,
    "base_saraly_employee": 1300000,
    "type_contract_employee": "Indefinido",
    "type_employee": "Diseñadora"
  }'
{
  "msj": "Empleado creado correctamente",
  "status": true,
  "save_employee": {
    "_id": "64b3c4d5e6f7a80034567890",
    "name_employee": "María Torres",
    "type_document_employee": "CC",
    "number_document_employee": 1098765432,
    "base_saraly_employee": 1300000,
    "type_contract_employee": "Indefinido",
    "stade_employee": "Inactivo",
    "type_employee": "Diseñadora",
    "company": "64a1f2e3b5c8d90012345678",
    "createdAt": "2024-07-15T09:00:00.000Z",
    "updatedAt": "2024-07-15T09:00:00.000Z"
  }
}

PUT /api/employee/update/:company_id/:employee_id

Updates an existing employee record. All fields are optional — only provided fields are updated. Path parameters
company_id
string
required
MongoDB ObjectId of the company.
employee_id
string
required
MongoDB ObjectId of the employee to update.
Body parameters
name_employee
string
Updated full name.
type_document_employee
string
Updated document type.
number_document_employee
number
Updated document number.
base_saraly_employee
number
Updated base salary. Note: the field name contains a typo (saraly) matching the source schema.
type_contract_employee
string
Updated contract type. Accepted values: Fijo, Indefinido, Prestaciones.
stade_employee
string
Employment status. Use Activo to activate the employee or Inactivo to deactivate.
type_employee
string
Updated employee role.
Response
msj
string
"Empleado actualizado correctamente" on success.
status
boolean
true on success.
curl -X PUT https://api.example.com/api/employee/update/64a1f2e3b5c8d90012345678/64b3c4d5e6f7a80034567890 \
  -H "token-access: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stade_employee": "Activo",
    "base_saraly_employee": 1500000
  }'
{
  "msj": "Empleado actualizado correctamente",
  "status": true
}

GET /api/employee/list/:company_id/:pag?/:perpage?

Returns a paginated list of all employees (active and inactive) for a company. Path parameters
company_id
string
required
MongoDB ObjectId of the company.
pag
string
Page number (optional, defaults to 1).
perpage
string
Items per page (optional).
Response
msj
string
"Cargando empleados" on success.
status
boolean
true on success.
data
array
Array of employee documents sorted by _id descending.
pagination
object
curl -X GET "https://api.example.com/api/employee/list/64a1f2e3b5c8d90012345678/1/20" \
  -H "token-access: Bearer $TOKEN"

GET /api/employee/list-active/:company_id/:pag?/:perpage?

Returns only employees with stade_employee set to Activo. Path parameters
company_id
string
required
MongoDB ObjectId of the company.
pag
string
Page number (optional, defaults to 1).
perpage
string
Items per page (optional).
Response
msj
string
"Cargando empleados activos" on success.
status
boolean
true on success.
data
array
Array of active employee documents sorted by _id descending.
pagination
object
Pagination metadata with pag, perpage, and pags.
curl -X GET "https://api.example.com/api/employee/list-active/64a1f2e3b5c8d90012345678/1/10" \
  -H "token-access: Bearer $TOKEN"

GET /api/employee/list-inactive/:company_id/:pag?/:perpage?

Returns only employees with stade_employee set to Inactivo. Path parameters
company_id
string
required
MongoDB ObjectId of the company.
pag
string
Page number (optional, defaults to 1).
perpage
string
Items per page (optional).
Response
msj
string
"Cargando empleados inactivos" on success.
status
boolean
true on success.
data
array
Array of inactive employee documents sorted by _id descending.
pagination
object
Pagination metadata with pag, perpage, and pags.
curl -X GET "https://api.example.com/api/employee/list-inactive/64a1f2e3b5c8d90012345678/1/10" \
  -H "token-access: Bearer $TOKEN"

DELETE /api/employee/remove/:employee_id

Permanently deletes an employee record.
This action is irreversible. Deleting an employee removes their record but does not remove historical references in production or roster documents.
Path parameters
employee_id
string
required
MongoDB ObjectId of the employee to delete.
Response
msj
string
"Empleado eliminado exitosamente" on success.
status
boolean
true on success.
curl -X DELETE https://api.example.com/api/employee/remove/64b3c4d5e6f7a80034567890 \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Empleado eliminado exitosamente",
  "status": true
}

Build docs developers (and LLMs) love