> ## Documentation Index
> Fetch the complete documentation index at: https://docs.capitalcheckin.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Eventos de webhook

> Catálogo 1.0.0 de eventos, disparadores y ejemplos JSON alineados con el listener

Esquema **1.0.0**. El sobre (`event`, `timestamp`, `data.event_type`, `data.timestamp`) es el de [Webhooks](/integrations/webhooks/overview). Los ejemplos de abajo son solo `data.data`, salvo que se indique lo contrario.

| Versión | Fecha | Cambio |
| - | - | - |
| 1.0.0 | 2026-10-02 | Catálogo inicial, alineado con `SendWebhookListener` y `SendWebhookJob` |

<Warning>
  `collaborator.created` serializa el modelo del colaborador, incluidos datos personales y de nómina. Trata el cuerpo como confidencial.
</Warning>

## Colaboradores

### `collaborator.created`

Se envía cuando se dispara `CollaboratorAdded` (alta del colaborador). `data.event_type` es `App\Events\CollaboratorAdded`.

`data.data` es el arreglo Eloquent del colaborador más `company_id`.

```json theme={null}
{
  "id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
  "first_name": "Ana",
  "last_name": "López",
  "email": "ana.lopez@example.com",
  "position": "Supervisor",
  "company_id": "018f6b3a-1111-7b1a-9f0a-2c3d4e5f6789"
}
```

### `collaborator.updated`

Disparador: `CollaboratorStatusUpdated`. `data.data` es el historial del colaborador (`CollaboratorHistoryCollection`). Si tiene grupo, incluye `group_id`.

### `collaborator.deleted`

Disparador: `CollaboratorDeleted`.

```json theme={null}
{
  "company_id": "018f6b3a-1111-7b1a-9f0a-2c3d4e5f6789",
  "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
  "timestamp": "2026-10-02T15:30:00-06:00",
  "reload_required": true
}
```

### `collaborator.state_changed`

Disparador: `CollaboratorStateChanged`.

```json theme={null}
{
  "collaborator": {
    "id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
    "status": "active",
    "is_online": true,
    "first_name": null,
    "available_document_types": []
  },
  "current_state": {
    "id": "018f6b3a-2222-7b1a-9f0a-2c3d4e5f6789",
    "name": "En sitio"
  },
  "group_id": "018f6b3a-3333-7b1a-9f0a-2c3d4e5f6789"
}
```

`group_id` solo viene si el colaborador pertenece a un grupo. `collaborator` es `CollaboratorResource::lightweight`: no incluye el catálogo de tipos de documento. El job corre en cola, sin usuario de la petición, así que los campos de nombre personal quedan en `null`. `current_state` es el modelo `State` al iniciar un estado, o `null` al terminarlo.

### `collaborator.online_status_changed`

Disparador: `CollaboratorOnlineStatusChanged`.

```json theme={null}
{
  "is_online": true,
  "last_seen": "2026-10-02T15:30:00-06:00",
  "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
  "group_id": "018f6b3a-3333-7b1a-9f0a-2c3d4e5f6789"
}
```

### `collaborator.checked_in` y `collaborator.checked_out`

Disparadores: `CollaboratorCheckedIn` y `CollaboratorCheckedOut`. El listener no copia la actividad al payload: `data` solo trae `event_type` y `timestamp`. No hay `data.data`.

## Actividades

`activity.created`, `activity.updated` y `activity.deleted` usan `ActivityResource`.

Disparadores: `ActivityCreated`, `ActivityUpdated`, `ActivityDeleted`.

```json theme={null}
{
  "id": "018f6b3a-4444-7b1a-9f0a-2c3d4e5f6789",
  "type": "check_in",
  "activity_type": "check_in",
  "activity_slug": null,
  "title": "Entrada",
  "description": null,
  "start_time": "2026-10-02T09:00:00-06:00",
  "end_time": null,
  "duration_seconds": null,
  "duration_in_minutes": null,
  "status": "open",
  "is_late": false,
  "verification_method": "app",
  "from_device": false,
  "recorded_offline": false,
  "timezone": "America/Mexico_City",
  "collaborator": {
    "id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
    "full_name": "Ana López",
    "email": "ana.lopez@example.com",
    "position": "Supervisor"
  },
  "location": null
}
```

El recurso también puede incluir `intervals`, `scheduled_time`, `activable`, usuarios de auditoría y campos de sincronización offline cuando aplican.

## Reportes

Si `gdpr.analytics.pseudonymize_report_webhook_payloads` está activo, el reporte se pseudonimiza y `data.data` incluye `"_pseudonymized": true`.

### `report.created`

Disparador: `ReportCreated`. Además del sobre, `data.idempotency_key` vale `report-created:{report_id}:{subscription_id}`.

```json theme={null}
{
  "report": {
    "id": "018f6b3a-5555-7b1a-9f0a-2c3d4e5f6789",
    "report_type_id": "018f6b3a-6666-7b1a-9f0a-2c3d4e5f6789",
    "type": "Incidencia",
    "type_slug": "incidencia",
    "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
    "collaborator": "Ana López",
    "data": {},
    "attachments": [],
    "created_at": "2026-10-02T15:30:00-06:00"
  }
}
```

`report.data` trae cada campo del formulario como `{ value, component, title, description, required }`.

### `report.updated` y `report.deleted`

Disparadores: `ReportUpdated` y `ReportDeleted`. No usan `ReportResource`. El cuerpo es el modelo Eloquent y `company_id` llega en `null` porque el evento no lo guarda.

```json theme={null}
{
  "report": {
    "id": "018f6b3a-5555-7b1a-9f0a-2c3d4e5f6789",
    "report_type_id": "018f6b3a-6666-7b1a-9f0a-2c3d4e5f6789",
    "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789"
  },
  "company_id": null
}
```

## Dispositivos

`device.created` y `device.deleted` sí se envían (`DeviceCreated`, `DeviceDeleted`). El listener no adjunta el dispositivo: `data` solo trae `event_type` y `timestamp`.

`device.updated` está en el enum y no se envía.

## Geocercas

### `geofence.created`

Disparador: `GeofenceCreated`.

```json theme={null}
{
  "id": "018f6b3a-7777-7b1a-9f0a-2c3d4e5f6789",
  "name": "Planta norte",
  "address": "Av. Ejemplo 100",
  "latitude": 28.6353,
  "longitude": -106.0889,
  "radius": 150,
  "geofence_type_id": "018f6b3a-8888-7b1a-9f0a-2c3d4e5f6789",
  "is_temporary": false,
  "notify_on_enter": true,
  "notify_on_exit": true,
  "type": "circle",
  "departments_count": 2,
  "collaborators_count": 14,
  "is_all_collaborators_assigned": false,
  "sample_department_ids": ["018f6b3a-9999-7b1a-9f0a-2c3d4e5f6789"],
  "sample_collaborator_ids": ["018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789"]
}
```

`sample_*` trae como máximo 5 identificadores.

### `geofence.deleted`

Disparador: `GeofenceDeleted`.

```json theme={null}
{
  "id": "018f6b3a-7777-7b1a-9f0a-2c3d4e5f6789",
  "name": "Planta norte"
}
```

`geofence.updated` está en el enum y no se envía.

## Horarios

`data.data` tiene siempre tres llaves: `schedule` (modelo Eloquent), `collaborator_ids` y `changed_data`.

### `schedule.created`

Disparador: `ScheduleAssigned`. `collaborator_ids` son los colaboradores asignados. `changed_data` es `null`.

```json theme={null}
{
  "schedule": {
    "id": "018f6b3a-aaaa-7b1a-9f0a-2c3d4e5f6789",
    "name": "Turno matutino",
    "status": "published",
    "timezone": "America/Mexico_City",
    "start_time": "09:00:00",
    "end_time": "18:00:00"
  },
  "collaborator_ids": ["018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789"],
  "changed_data": null
}
```

### `schedule.updated`

Disparador: `ScheduleUpdated`. `collaborator_ids` es `null`. `changed_data` son los atributos que cambiaron.

```json theme={null}
{
  "schedule": {
    "id": "018f6b3a-aaaa-7b1a-9f0a-2c3d4e5f6789",
    "name": "Turno matutino"
  },
  "collaborator_ids": null,
  "changed_data": {
    "end_time": "17:00:00"
  }
}
```

`schedule.deleted` está en el enum y no se envía.

## Solicitudes de estado

### `state_request.created`

Disparador: `StateRequestCreated`.

```json theme={null}
{
  "type": "state_request_created",
  "state_request": {
    "id": "018f6b3a-bbbb-7b1a-9f0a-2c3d4e5f6789",
    "start_date": "2026-10-06T00:00:00-06:00",
    "end_date": "2026-10-06T23:59:59-06:00",
    "description": "Cita médica",
    "is_all_day": true,
    "status": "pending",
    "collaborator": null,
    "state": null
  },
  "group_id": "018f6b3a-3333-7b1a-9f0a-2c3d4e5f6789"
}
```

`collaborator` y `state` vienen poblados solo si esas relaciones estaban cargadas. `group_id` solo si el colaborador tiene grupo.

### `state_request.updated`

Disparador: `StateRequestUpdated`. Igual que el alta, con `type` en `state_request_updated` y un objeto `changes` con los atributos modificados.

### `state_request.deleted`

Disparador: `StateRequestDeleted`.

```json theme={null}
{
  "type": "state_request_deleted",
  "state_request_id": "018f6b3a-bbbb-7b1a-9f0a-2c3d4e5f6789",
  "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
  "state_id": "018f6b3a-cccc-7b1a-9f0a-2c3d4e5f6789",
  "group_id": "018f6b3a-3333-7b1a-9f0a-2c3d4e5f6789"
}
```

## Ausencias

`absence.created`, `absence.updated` y `absence.deleted` envían `absence->toArray()`.

```json theme={null}
{
  "id": "018f6b3a-dddd-7b1a-9f0a-2c3d4e5f6789",
  "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
  "schedule_id": "018f6b3a-aaaa-7b1a-9f0a-2c3d4e5f6789",
  "absence_type_id": "018f6b3a-eeee-7b1a-9f0a-2c3d4e5f6789",
  "date": "2026-10-02",
  "is_excused": false,
  "excuse_kind": null,
  "excuse_reason": null,
  "excuse_comment": null,
  "collaborator_snapshot": null,
  "schedule_snapshot": null,
  "absence_type_snapshot": null
}
```

## Retardos

`tardiness.created`, `tardiness.updated` y `tardiness.deleted` envían `tardiness->toArray()`.

```json theme={null}
{
  "id": "018f6b3a-ffff-7b1a-9f0a-2c3d4e5f6789",
  "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
  "schedule_id": "018f6b3a-aaaa-7b1a-9f0a-2c3d4e5f6789",
  "occurred_at": "2026-10-02T09:12:00.000000Z",
  "occurred_local_date": "2026-10-02",
  "minutes_late": 12,
  "minutes_from_schedule": 12,
  "minutes_over_tolerance": 2,
  "absence_generated": false,
  "tardiness_count_when_occurred": 1
}
```

## Check-in no programado

### `non_scheduled_checkin_request.created`

Disparador: `NonScheduledCheckinRequestCreated`.

```json theme={null}
{
  "id": "018f6b3a-1212-7b1a-9f0a-2c3d4e5f6789",
  "collaborator_id": "018f6b3a-7c2e-7b1a-9f0a-2c3d4e5f6789",
  "collaborator_name": "Ana López",
  "requested_date": "2026-10-03",
  "status": "pending",
  "created_at": "2026-10-02T15:30:00.000000Z",
  "group": {
    "id": "018f6b3a-3333-7b1a-9f0a-2c3d4e5f6789",
    "name": "Turno A"
  },
  "user_role": "employee",
  "profile_photo": null,
  "department": {
    "id": "018f6b3a-9999-7b1a-9f0a-2c3d4e5f6789",
    "name": "Operaciones"
  },
  "idp": null
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.