Documentation / API

Zones

Geographic zones of an organization (polygons and circles): drawn once, shown by map widgets and used for geofencing.

All paths are relative to https://apiv1.opensensorcloud.com/api/v1.

Endpoints

Method and path Role Result
GET /orgs/{orgId}/zones member array of zones, sorted by name
GET /orgs/{orgId}/zones/{zoneId} member the zone
POST /orgs/{orgId}/zones editor 201, the zone
PUT /orgs/{orgId}/zones/{zoneId} editor the zone (full replacement)
DELETE /orgs/{orgId}/zones/{zoneId} editor 204

Changes are recorded in the audit log (zone.create, zone.update, zone.delete).

The zone object

Points are [longitude, latitude] in decimal degrees (GeoJSON order).

{
  "id": "6f1c…",
  "name": "Depot",
  "kind": "polygon",
  "geometry": { "coordinates": [[4.825, 45.753], [4.838, 45.753], [4.838, 45.762], [4.825, 45.762]] },
  "forbidden": false,
  "color": null,
  "createdAt": "2026-11-16T09:00:00.000Z",
  "updatedAt": "2026-11-16T09:00:00.000Z"
}
Field Rules
name 1 to 80 characters (trimmed), unique in the organization ignoring case
kind polygon or circle
geometry polygon: { coordinates }, 3 to 500 points, closed (last point = first) or not; circle: { center: [lng, lat], radiusM }, radius from 1 m to 200 km. Longitude in [-180, 180], latitude in [-90, 90]
forbidden optional, default false: entering this zone is abnormal (read by scripts and alert rules)
color optional #RRGGBB, default null (red when forbidden, blue otherwise)

The body of POST and PUT is the object without id, createdAt and updatedAt. A circle:

{ "name": "Quarry", "kind": "circle", "geometry": { "center": [4.9, 45.8], "radiusM": 300 }, "forbidden": true, "color": "#D9534F" }

Errors

Status error Cause
400 validation invalid name, kind, geometry or color
404 not_found unknown zone, or a zone of another organization
409 zone_name_taken another zone of the organization has this name
409 zone_limit the organization already has 200 zones

Public dashboards

GET /public/dashboards/{token}/zones returns the zones of the dashboard's organization, only when one of its map widgets has showZones: true (otherwise 404). See Dashboards.