v1 · preview

Try webhook signature, alert.created, location_withheld or 429.

↑ ↓ moveEnter openEsc close

Reference

Events

Replay the events of the last 30 days.

Replay events

GET/v1/events

Any valid token.

The same ones that arrive by webhook, kept for 30 days: to recover what was lost after an outage on your receiver.

Query parameters

  • sincestring (date-time)required

    Since when (at most 30 days back).

  • muster.updated: the headcount has changed (checked every 5 s, only emitted if it changes). muster.targets_changed: the control room has ruled out or restored a muster point.

    Possible values: alert.createdalert.acknowledgedalert.resolvedalert.reopenedalert.worker_acknowledgedmuster.startedmuster.kind_changedmuster.phase_changedmuster.targets_changedmuster.updatedmuster.worker_missingmuster.ended

  • limitinteger

    Items per page (maximum 500).

    from 1 to 500 · default 100

  • cursorstring

    The next_cursor from the previous page.

Responses

  • 200

    Events, from the oldest to the most recent.

    application/json EventPage

  • 401

    The token is missing, has expired or has been revoked.

    application/problem+json Problem

  • 403

    The token lacks the scope the route requires, or the site doesn’t belong to the client.

    application/problem+json Problem

  • 429

    Too many requests, or too much query time: each client has a number of requests per minute (600 by default) and a query time per minute (30 s by default), and each request spends however long it takes, so a long list counts for more than a single alert. Retry-After says when to retry.

    application/problem+json Problem

Request · sandbox

curl "https://sandbox.api.safeonuba.com/v1/events?since=2026-09-24T11%3A04%3A12Z" \
  -H "Authorization: Bearer $SAFEONUBA_TOKEN"

Response 200

JSON
{
  "data": [
    {
      "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
      "type": "alert.created",
      "api_version": "2026-09-24",
      "created_at": "2026-09-24T11:04:12Z",
      "organization_id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
      "site_id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
      "data": {
        "alert": {
          "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
          "type": "sos",
          "severity": "critical",
          "status": "unacknowledged",
          "title": "SOS activado — Ana Ejemplo",
          "date_created": "2026-09-24T11:04:12Z",
          "date_last_modified": "2026-09-24T11:04:12Z",
          "site": {
            "id": "11111111-1111-1111-1111-111111111111",
            "name": "Planta Ejemplo — simulación"
          },
          "zone": null,
          "worker": {
            "id": "33333333-3333-3333-3333-333333333305",
            "external_id": "EMP-004512",
            "name": "Ana Ejemplo",
            "contractor": "Contrata Ejemplo A"
          },
          "device": {
            "id": "44444444-4444-4444-4444-444444444405",
            "serial": "OS-W-0005",
            "battery": 64,
            "date_last_seen": "2026-09-24T11:04:10Z"
          },
          "location": {
            "latitude": 40.00121,
            "longitude": -3.00214,
            "uncertainty_m": 8,
            "source": "gps",
            "masked": false,
            "position_date_utc": "2026-09-24T11:04:08Z",
            "height": null
          },
          "location_withheld": false,
          "details": {
            "trigger": "watch_button"
          },
          "nearby": [
            {
              "kind": "vehicle",
              "worker": {
                "id": "33333333-3333-3333-3333-333333333309",
                "external_id": "EMP-002210",
                "name": "Carlos Ejemplo",
                "contractor": "Contrata Ejemplo B"
              },
              "vehicle_type": "Grúa móvil",
              "distance_m": 18,
              "reported_at": "2026-09-24T11:04:02Z"
            },
            {
              "kind": "person",
              "worker": {
                "id": "33333333-3333-3333-3333-333333333301",
                "external_id": "EMP-000981",
                "name": "Diego Ejemplo",
                "contractor": null
              },
              "vehicle_type": null,
              "distance_m": 26,
              "reported_at": "2026-09-24T11:03:58Z"
            }
          ],
          "vehicle_warnings": [],
          "worker_acknowledged_at": null,
          "acknowledged": null,
          "resolved": null,
          "assigned_to": null,
          "simulated": false,
          "panel_url": "https://app.safeonuba.com/alertas/0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90"
        }
      }
    }
  ],
  "next_cursor": "eyJ0IjoiMjAyNi0wOS0yNFQxMTowNDoxMloifQ"
}