See the Geofencing feature page for business context, integration patterns, and configuration guidance.
Base Path
GET /api/v1/geofences
List all geofences for the current tenant, ordered by creation date (newest first). Roles: admin, editor, viewerResponse 200
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique geofence identifier |
tenantId | string | Tenant identifier |
name | string | Human-readable name |
description | string | Optional description |
latitude | number | Center latitude |
longitude | number | Center longitude |
radiusMeters | integer | Radius in meters |
triggerOn | string | Trigger type: enter, exit, or dwell |
dwellMinutes | integer or null | Minutes required for dwell triggers |
cooldownMs | integer | Cooldown period in milliseconds |
action | object | Action payload to execute on trigger |
status | string | active or inactive |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last update timestamp |
Example
POST /api/v1/geofences
Create a new geofence. Roles: admin, editorRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Geofence name |
description | string | No | Optional description |
latitude | number | Yes | Center latitude (-90 to 90) |
longitude | number | Yes | Center longitude (-180 to 180) |
radiusMeters | integer | No | Radius in meters. Default: 500 |
triggerOn | string | No | enter, exit, or dwell. Default: enter |
dwellMinutes | integer | No | Minutes for dwell triggers |
cooldownMs | integer | No | Cooldown in ms. Default: 86400000 (24h) |
action | object | No | Action payload |
status | string | No | active or inactive. Default: active |
Response 201
Returns the created geofence object (same shape as GET response items).
Example
PUT /api/v1/geofences
Update an existing geofence. The request body must include theid field. All other fields are optional and only provided fields are updated.
Roles: admin, editor
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Geofence ID to update |
name | string | No | Updated name |
description | string | No | Updated description |
latitude | number | No | Updated latitude |
longitude | number | No | Updated longitude |
radiusMeters | integer | No | Updated radius |
triggerOn | string | No | Updated trigger type |
dwellMinutes | integer | No | Updated dwell time |
cooldownMs | integer | No | Updated cooldown |
action | object | No | Updated action payload |
status | string | No | Updated status |
Response 200
Returns the updated geofence object.
Example
DELETE /api/v1/geofences
Permanently delete a geofence. Roles: adminQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Geofence ID to delete |
Response 200
Example
POST /api/v1/geofences/check
Check which active geofences a given coordinate falls within. Uses the Haversine formula for distance calculation. Roles: admin, editor, viewerRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
latitude | number | Yes | Current latitude |
longitude | number | Yes | Current longitude |
customerId | string | No | Optional customer identifier (returned in the response for correlation) |
Response 200
Match Fields
| Field | Type | Description |
|---|---|---|
geofenceId | string | ID of the matched geofence |
geofenceName | string | Name of the matched geofence |
distance | integer | Distance in meters from the coordinate to the geofence center |
radiusMeters | integer | Radius of the geofence |
action | object | Action payload configured on this geofence |
triggerOn | string | Trigger type (enter, exit, dwell) |
Example
Error Codes
| Status | Code | Description |
|---|---|---|
400 | Bad Request | Missing required fields (name, latitude, longitude for create; id for update/delete; latitude/longitude for check) |
401 | Unauthorized | Missing or invalid authentication |
403 | Forbidden | Insufficient role for this operation |
404 | Not Found | Geofence ID not found (update/delete) |
500 | Server Error | Internal error |