v1 · preview

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

↑ ↓ moveEnter openEsc close

Concepts

Alerts

Alert types, severity and states; the difference between the control room taking charge and the worker seeing the alert; and how to acknowledge or close it.

On this page

An alert is something that has happened in the plant and that someone has to deal with: an SOS, a fall, someone entering where they shouldn’t, a watch with a flat battery or an earthquake warning. It’s the central object of the API.

The object

The alert arrives complete in every webhook (data.alert) and is what GET /v1/alerts/{id} returns. The most commonly used fields:

FieldWhat it is
type, severity, statusWhat has happened, how serious it is and where it stands in the response.
titleThe title the control room reads.
site, zoneWhere. zone can be null.
worker, deviceWho it happened to and with which watch. null in plant-wide alerts.
location, location_withheldWhere the person is, if the plant’s privacy level allows it to be seen.
detailsData specific to each type.
acknowledged, resolved, assigned_toWho has taken charge, who has closed it and who it is assigned to.
date_created, date_last_modifiedWhen it was created and when it last changed.
simulatedtrue if it comes from a drill or from simulated watches.
panel_urlLink to its page in the SafeOnuba dashboard.

The full list, field by field, is in the schema Alert.

Types

typeWhat it means
sosThe person has asked for help from the watch, or the control room has raised it on their behalf.
fall_detectedThe watch has detected a fall.
restricted_zone_entryEntry into a restricted zone.
forbidden_zone_entryEntry into an off-limits zone.
permit_expired_insideThe permit to work has expired with the person still inside the zone.
permit_closed_insideThe permit to work has been closed with the person still inside the zone.
heat_stressHeat stress: the watch has told them to stop and rest.
evacuation_helpDuring an evacuation, the person says from the watch that they can’t get out on their own or that they are helping someone else.
worker_call_requestThe person alerts the control room from the watch. Without coverage, the watch records a voice message that can be heard in the dashboard.
device_offlineThe watch hasn’t communicated for a while.
low_batteryThe watch is low on battery.
earthquakeEarthquake. It is plant-wide: it carries no worker or device.
tsunami_riskTsunami risk. It is plant-wide: it carries no worker or device.

A nearby vehicle is not an alert

Nearby-vehicle warnings don’t generate alerts of their own. They go inside the alert for an incident, in two lists:

  • nearby: who was within 100 metres when a critical alert (SOS or fall) was raised, people or vehicles. It gives the distance, never the position, and doesn’t count anyone who was in a privacy zone.
  • vehicle_warnings: the nearby-vehicle warnings that person received in the incident window, with the distance and whether they saw them on the watch.

Details for each type

details changes according to type. For example, SosDetails says how the SOS was raised (trigger), ZoneDetails carries the permit to work that applied (permit_reference) and HazardDetails the magnitude, the distance and whether the warning is official. The variants are in AlertDetails.

Severity

severityWhat it means
lowInformation.
mediumWarning.
highSerious.
criticalCritical: SOS, fall, “I can’t evacuate”.

The severity filter of GET /v1/alerts and the min_severity of webhooks are minimums: high returns high and critical.

States

statusWhat it means
unacknowledgedNobody has taken charge yet.
acknowledgedAn operator has taken charge.
resolvedClosed.
  • Acknowledging assigns the alert to whoever acknowledges it, if nobody was handling it. Acknowledging is not resolving: an acknowledged alert keeps marking the person on the map until it is resolved.
  • Resolving records who, when and with what note, in resolved.
  • A resolved alert can be reopened. The alert.reopened event announces it.

Acknowledging and resolving from your control room

PUT /v1/alerts/{id} with the alerts:write scope. The body:

FieldRequiredWhat it is
statusYesacknowledged or resolved.
actorYesYour control room’s operator: name and, if you want, external_id.
resolution_reasonNoWhen resolving, why. Up to 200 characters.
noteNoA note. Up to 500 characters.

The operator is required because “acknowledged” measures a person’s response. In the alert’s timeline it appears as “Customer · Operator (via integration)”.

curl -X PUT https://sandbox.api.safeonuba.com/v1/alerts/0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90 \
  -H "Authorization: Bearer $SAFEONUBA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "resolved",
    "resolution_reason": "False alarm",
    "note": "Confirmed by radio with the supervisor.",
    "actor": { "name": "E. Example", "external_id": "OP-117" }
  }'

The response is the updated alert. If the transition isn’t possible —for example, resolving or acknowledging an alert that is already resolved— the API responds 409.

Querying alerts

GET /v1/alerts returns alerts from newest to oldest, paginated. Filters:

ParameterWhat it filters
site_idA site.
typeA type.
statusA state.
severityMinimum severity.
since, untilDate range, in ISO 8601.
limit, cursorPagination (see Pagination).

To follow alerts in real time, don’t poll in a loop: use webhooks. The list is for loading the state at start-up and for searching.

Worker names

Names are optional by contract. If your contract doesn’t include them, worker.name doesn’t appear and title is built from the type, the zone and the company identifier (external_id), without a name. See Workers and watches.