Praesenti
API

Análisis y Reportes

Los endpoints de análisis te permiten obtener reportes detallados de asistencia, control de presencia de los empleados

Reporte de Control de Asistencia

Obtiene datos de asistencia por día a nivel general, sin entrar en el detalle de cada empleado. from no puede ser posterior a to y el rango puede abarcar como máximo 60 días, contando ambos extremos. El día indicado en to se incluye completo.

Método: GET /analysis

Parámetros de Query (Requeridos)

ParámetroTipoDescripción
fromstring (RFC3339)Requerido - Fecha inicial (ej: 2025-09-15T00:00:00-03:00)
tostring (RFC3339)Requerido - Fecha final (ej: 2025-09-15T00:00:00-03:00)
employeeIDsstringOpcional - IDs de empleados separados por comas
areaIDsstringOpcional - IDs de áreas separadas por comas

Respuesta exitosa (200)

[
  {
    "day": "2026-06-01T00:00:00-03:00",
    "expected": 1,
    "attendances": 0,
    "lateArrivals": 1,
    "absences": 0,
    "justified": 0,
    "totalClockIOs": 2,
    "EmployeeAnalysis": null
  },
  {
    "day": "2026-06-02T00:00:00-03:00",
    "expected": 1,
    "attendances": 0,
    "lateArrivals": 0,
    "absences": 1,
    "justified": 0,
    "totalClockIOs": 0,
    "EmployeeAnalysis": null
  },
  {
    "day": "2026-06-03T00:00:00-03:00",
    "expected": 1,
    "attendances": 0,
    "lateArrivals": 0,
    "absences": 1,
    "justified": 0,
    "totalClockIOs": 0,
    "EmployeeAnalysis": null
  },
  {
    "day": "2026-06-04T00:00:00-03:00",
    "expected": 3,
    "attendances": 0,
    "lateArrivals": 3,
    "absences": 0,
    "justified": 0,
    "totalClockIOs": 4,
    "EmployeeAnalysis": null
  }
]

El campo EmployeeAnalysis siempre viene en null en este endpoint.

Códigos de respuesta

CódigoDescripción
200Exitoso
400Faltan from o to, formato de fecha inválido o rango mayor a 60 días
401No autorizado
403Prohibido
404No encontrado
500Error interno del servidor

Reporte Detallado de Control de Asistencia

Obtiene el estado detallado de asistencia por empleado para un día específico, incluyendo turnos, justificaciones y registros de fichada. También incluye los turnos del día anterior que terminan después de medianoche (con previousDay: true).

  • status: present, late, absent, day-off o non-working-day.
  • shiftType: fixed (turno fijo), rotation (turno rotativo) o one-time (turno puntual).
  • shiftStartsAt y shiftEndsAt: minutos desde la medianoche (por ejemplo, 600 = 10:00).
  • unexpectedClockIOs: fichadas que no corresponden a ningún turno del día.

Método: GET /analysis/detailed

Parámetros de Query (Requeridos)

ParámetroTipoDescripción
datestring (RFC3339)Requerido - Fecha (ej: 2025-09-15T00:00:00-03:00)
employeeIDsstringOpcional - IDs de empleados separados por comas
areaIDsstringOpcional - IDs de áreas separadas por comas

Respuesta exitosa (200)

{
  "employeeShifts": [
    {
      "id": "fixed-208-today-914",
      "groupID": "fixed-208-today",
      "status": "late",
      "shiftType": "fixed",
      "shiftID": 208,
      "countAsExtraHours": false,
      "employeeID": 914,
      "shiftName": "Turno Mañana",
      "shiftStartsAt": 600,
      "shiftEndsAt": 840,
      "clockIn": null,
      "clockOut": null,
      "clocks": [
        {
          "clockIn": "2026-06-04T10:00:00-03:00",
          "clockOut": "2026-06-04T12:22:00-03:00"
        },
        {
          "clockIn": "2026-06-04T12:25:00-03:00",
          "clockOut": "2026-06-04T13:26:00-03:00"
        }
      ],
      "justificationMessage": null,
      "employee": {
        "id": 914,
        "createdAt": "2026-06-01T15:40:42.181Z",
        "updatedAt": "2026-06-12T15:47:14.608Z",
        "deletedAt": null,
        "name": "Juan Pérez",
        "mobileID": null,
        "mobileEnabled": false,
        "faceRecognition": null,
        "internalID": null,
        "dni": 11222333,
        "email": null,
        "phoneNumber": null,
        "category": {
          "id": 309,
          "createdAt": "2026-06-01T15:40:25.526Z",
          "updatedAt": "2026-06-04T15:12:04.116Z",
          "deletedAt": null,
          "name": "Cajero",
          "areaID": 172,
          "area": {
            "id": 172,
            "createdAt": "2026-06-01T15:40:25.523Z",
            "updatedAt": "2026-06-04T15:12:04.121Z",
            "deletedAt": null,
            "name": "Atención al cliente",
            "colorCode": "#00b8ff"
          }
        },
        "archived": false
      },
      "previousDay": false,
      "createdByExchange": false
    },
    {
      "id": "fixed-208-today-931",
      "groupID": "fixed-208-today",
      "status": "late",
      "shiftType": "fixed",
      "shiftID": 208,
      "countAsExtraHours": false,
      "employeeID": 931,
      "shiftName": "Turno Mañana",
      "shiftStartsAt": 600,
      "shiftEndsAt": 840,
      "clockIn": null,
      "clockOut": null,
      "clocks": [
        {
          "clockIn": "2026-06-04T09:58:00-03:00",
          "clockOut": "2026-06-04T13:00:00-03:00"
        }
      ],
      "justificationMessage": null,
      "employee": {
        "id": 931,
        "createdAt": "2026-06-04T15:14:52.113Z",
        "updatedAt": "2026-06-04T15:14:52.113Z",
        "deletedAt": null,
        "name": "Mariana Sánchez",
        "mobileID": null,
        "mobileEnabled": false,
        "faceRecognition": null,
        "internalID": null,
        "dni": 22333444,
        "email": null,
        "phoneNumber": null,
        "category": {
          "id": 317,
          "createdAt": "2026-06-04T15:11:48.458Z",
          "updatedAt": "2026-06-04T15:11:48.458Z",
          "deletedAt": null,
          "name": "Contable",
          "areaID": 176,
          "area": {
            "id": 176,
            "createdAt": "2026-06-04T15:11:48.455Z",
            "updatedAt": "2026-06-04T15:11:48.455Z",
            "deletedAt": null,
            "name": "Administración",
            "colorCode": "#37915a"
          }
        },
        "archived": false
      },
      "previousDay": false,
      "createdByExchange": false
    }
  ],
  "unexpectedClockIOs": [
    {
      "employee": {
        "id": 951,
        "createdAt": "2026-06-01T15:40:42.181Z",
        "updatedAt": "2026-06-12T15:47:14.608Z",
        "deletedAt": null,
        "name": "John Pérez",
        "mobileID": null,
        "mobileEnabled": false,
        "faceRecognition": null,
        "internalID": 333,
        "dni": 3333333,
        "email": null,
        "phoneNumber": null,
        "category": {
          "id": 319,
          "createdAt": "2026-06-01T15:40:25.526Z",
          "updatedAt": "2026-06-04T15:12:04.116Z",
          "deletedAt": null,
          "name": "Cajero",
          "areaID": 172,
          "area": {
            "id": 172,
            "createdAt": "2026-06-01T15:40:25.523Z",
            "updatedAt": "2026-06-04T15:12:04.121Z",
            "deletedAt": null,
            "name": "Atención al cliente",
            "colorCode": "#00b8ff"
          }
        },
        "archived": false
      },
      "clockIn": "2026-06-11T22:00:00Z",
      "clockOut": "2026-06-12T01:00:00Z"
    }
  ]
}

Códigos de respuesta

CódigoDescripción
200Exitoso
400Falta date o tiene formato inválido
401No autorizado
403Prohibido
404No encontrado
500Error interno del servidor