Skip to main content

Overview

These endpoints manage employee breaks during their work shifts. The system supports different types of breaks including meal breaks (COMIDA) and other breaks (OTRA).

Start Break

Initiates a break period for an employee during their active work shift.

Request Body

empleadoId
integer
required
The unique identifier of the employee starting a break
unidadId
integer
required
The ID of the unit/location where the break is being started
pausa
enum
required
The type of break being started. Allowed values:
  • COMIDA - Meal break
  • OTRA - Other type of break
foto
string
Base64-encoded photo of the employee (optional)
unidadAsignadaId
integer
The ID of the employee’s assigned unit (optional)
hora
string
Custom time for break start in HH:mm:ss format (optional). If not provided, current time is used

Response

success
boolean
Indicates whether the operation was successful
data
null
No data is returned for this endpoint
message
string
Confirmation message: “Pausa iniciada”

Example Request

cURL
curl -X POST https://api.integra.com/asistencia/pausa/iniciar \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "empleadoId": 123,
    "unidadId": 5,
    "pausa": "COMIDA",
    "foto": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
    "hora": "13:00:00"
  }'

Response Example

Success Response
{
  "success": true,
  "data": null,
  "message": "Pausa iniciada"
}

End Break

Finalizes an active break period for an employee.

Request Body

empleadoId
integer
required
The unique identifier of the employee ending a break
unidadId
integer
required
The ID of the unit/location where the break is being ended
pausa
enum
required
The type of break being ended. Must match the type of the active break:
  • COMIDA - Meal break
  • OTRA - Other type of break
foto
string
Base64-encoded photo of the employee (optional)
unidadAsignadaId
integer
The ID of the employee’s assigned unit (optional)
hora
string
Custom time for break end in HH:mm:ss format (optional). If not provided, current time is used

Response

success
boolean
Indicates whether the operation was successful
data
null
No data is returned for this endpoint
message
string
Confirmation message: “Pausa registrada”

Example Request

cURL
curl -X POST https://api.integra.com/asistencia/pausa/finalizar \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "empleadoId": 123,
    "unidadId": 5,
    "pausa": "COMIDA",
    "foto": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
    "hora": "14:00:00"
  }'

Response Example

Success Response
{
  "success": true,
  "data": null,
  "message": "Pausa registrada"
}
Error Response
{
  "success": false,
  "message": "No hay pausa activa para finalizar"
}

Break Types

COMIDA (Meal Break)

Used for scheduled meal breaks during the work shift. Typically longer in duration and may have specific scheduling rules.

OTRA (Other Break)

Used for any other type of break (bathroom, rest, etc.). Generally shorter in duration.

Business Rules

  • An employee must have an active shift to start a break
  • Only one break can be active at a time per employee
  • The break type when ending must match the break type that was started
  • Break end time must be after break start time
  • The empleadoId, unidadId, and pausa fields are mandatory
  • Break duration may be subject to company policies and labor regulations

Build docs developers (and LLMs) love