Alerts and event export
Rules that watch your vehicles (an area left, a zone entered, silence, a long stop), the alerts they raise, and every event as CSV or JSON.
On this page
- List alert rules
- Add an alert rule (up to 100)
- Get a rule
- Change a rule (the kind stays); active false pauses it and resolves its open alerts
- Delete a rule (its open alerts are resolved)
- Alerts raised, newest first
- Get an alert
- Acknowledge an open alert (no more reminders; it stays until it clears or is resolved)
- Resolve an alert (sends asset.alert_resolved)
- Download every event (CSV for Excel or Google Sheets, or JSON)
Send your key as key=YOUR_API_KEY on the address, or in the X-NWays-Api-Key header. API keys
Base address: https://nways.ng/maps/v1/fleet
List alert rules
GET https://nways.ng/maps/v1/fleet/alert-rules
curl "https://nways.ng/maps/v1/fleet/alert-rules" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/alert-rules', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/alert-rules",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
Rules
| Field | Type | Description |
|---|---|---|
rules | AlertRule[] | Required. |
rules[].id | string | |
rules[].name | string | Up to 100 characters. |
rules[].kind | string | Required. tracker_alarm: a GPS tracker's alarms (pick which with alarms); without a rule, SOS, power cut, tow and crash go to owners, admins and dispatchers at once and the others once. crash: a driver's phone detected a possible crash and help was sent (N-Ways drivers only during your started deliveries; N-Ways Business riders on duty or on a job). A crash rule only picks assets, channels and recipients; without one, owners, admins and dispatchers get every channel. Quiet hours never hold a crash back. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
rules[].active | boolean | Default: true. |
rules[].scope | object | Which assets; empty lists = the whole fleet. |
rules[].scope.vehicleIds | string[] | |
rules[].scope.groups | string[] | |
rules[].scope.modes | string[] | |
rules[].area | string | geofence_exit: each delivery's own area, or zones. One of: dispatch, zones. |
rules[].zoneIds | string[] | geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot). |
rules[].silentS | integer | Default: 1800. ≥ 120, ≤ 604800. |
rules[].idleS | integer | Default: 1200. ≥ 120, ≤ 86400. |
rules[].idleRadiusM | integer | Default: 100. ≥ 20, ≤ 5000. |
rules[].channels | string[] | Default: ["email","push","webhook"]. |
rules[].email | Recipients | |
rules[].email.roles | string[] | |
rules[].email.userIds | integer[] | Team members (console user ids). |
rules[].email.addresses | string (email)[] | Email only: any address. At most 20 items. |
rules[].push | Recipients | |
rules[].push.roles | string[] | |
rules[].push.userIds | integer[] | Team members (console user ids). |
rules[].push.addresses | string (email)[] | Email only: any address. At most 20 items. |
rules[].quietHours | object | null | Lagos time: emails, pushes and webhooks wait until they end. |
rules[].quietHours.from | string | |
rules[].quietHours.to | string | |
rules[].alarms | string[] | tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation. |
rules[].realertS | integer | 0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600. |
rules[].createdBy | string | |
rules[].createdAt | string (date-time) | |
rules[].updatedAt | string (date-time) |
{
"rules": [
{
"name": "Boats leave their route area",
"kind": "geofence_exit",
"area": "dispatch",
"scope": {
"modes": [
"boat"
]
},
"channels": [
"webhook",
"email",
"push"
],
"email": {
"roles": [
"owner",
"dispatcher"
],
"addresses": [
"ops@example.ng"
]
},
"push": {
"roles": [
"dispatcher"
]
},
"quietHours": {
"from": "22:00",
"to": "06:00"
},
"realertS": 900
}
]
}Errors
defaultError
Add an alert rule (up to 100)
POST https://nways.ng/maps/v1/fleet/alert-rules
Evaluated on our servers whether or not anyone has the console open: geofences on each position you send, silent and idle every 30 seconds. One open alert per rule, asset and subject; one that cleared isn't opened again for 5 minutes; reminders every realertS until acknowledged.
Request body
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | Up to 100 characters. |
kind | string | Required. tracker_alarm: a GPS tracker's alarms (pick which with alarms); without a rule, SOS, power cut, tow and crash go to owners, admins and dispatchers at once and the others once. crash: a driver's phone detected a possible crash and help was sent (N-Ways drivers only during your started deliveries; N-Ways Business riders on duty or on a job). A crash rule only picks assets, channels and recipients; without one, owners, admins and dispatchers get every channel. Quiet hours never hold a crash back. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
active | boolean | Default: true. |
scope | object | Which assets; empty lists = the whole fleet. |
scope.vehicleIds | string[] | |
scope.groups | string[] | |
scope.modes | string[] | |
area | string | geofence_exit: each delivery's own area, or zones. One of: dispatch, zones. |
zoneIds | string[] | geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot). |
silentS | integer | Default: 1800. ≥ 120, ≤ 604800. |
idleS | integer | Default: 1200. ≥ 120, ≤ 86400. |
idleRadiusM | integer | Default: 100. ≥ 20, ≤ 5000. |
channels | string[] | Default: ["email","push","webhook"]. |
email | Recipients | |
email.roles | string[] | |
email.userIds | integer[] | Team members (console user ids). |
email.addresses | string (email)[] | Email only: any address. At most 20 items. |
push | Recipients | |
push.roles | string[] | |
push.userIds | integer[] | Team members (console user ids). |
push.addresses | string (email)[] | Email only: any address. At most 20 items. |
quietHours | object | null | Lagos time: emails, pushes and webhooks wait until they end. |
quietHours.from | string | |
quietHours.to | string | |
alarms | string[] | tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation. |
realertS | integer | 0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600. |
createdBy | string | |
createdAt | string (date-time) | |
updatedAt | string (date-time) |
curl -X POST "https://nways.ng/maps/v1/fleet/alert-rules" \
-H "X-NWays-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Boats leave their route area","kind":"geofence_exit","area":"dispatch","scope":{"modes":["boat"]},"channels":["webhook","email","push"],"email":{"roles":["owner","dispatcher"],"addresses":["ops@example.ng"]},"push":{"roles":["dispatcher"]},"quietHours":{"from":"22:00","to":"06:00"},"realertS":900}'const res = await fetch('https://nways.ng/maps/v1/fleet/alert-rules', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "Boats leave their route area",
"kind": "geofence_exit",
"area": "dispatch",
"scope": {
"modes": [
"boat"
]
},
"channels": [
"webhook",
"email",
"push"
],
"email": {
"roles": [
"owner",
"dispatcher"
],
"addresses": [
"ops@example.ng"
]
},
"push": {
"roles": [
"dispatcher"
]
},
"quietHours": {
"from": "22:00",
"to": "06:00"
},
"realertS": 900
}),
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/alert-rules",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"name": "Boats leave their route area", "kind": "geofence_exit", "area": "dispatch", "scope": {"modes": ["boat"]}, "channels": ["webhook", "email", "push"], "email": {"roles": ["owner", "dispatcher"], "addresses": ["ops@example.ng"]}, "push": {"roles": ["dispatcher"]}, "quietHours": {"from": "22:00", "to": "06:00"}, "realertS": 900},
timeout=10,
)
data = res.json()Response
Created
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | Up to 100 characters. |
kind | string | Required. tracker_alarm: a GPS tracker's alarms (pick which with alarms); without a rule, SOS, power cut, tow and crash go to owners, admins and dispatchers at once and the others once. crash: a driver's phone detected a possible crash and help was sent (N-Ways drivers only during your started deliveries; N-Ways Business riders on duty or on a job). A crash rule only picks assets, channels and recipients; without one, owners, admins and dispatchers get every channel. Quiet hours never hold a crash back. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
active | boolean | Default: true. |
scope | object | Which assets; empty lists = the whole fleet. |
scope.vehicleIds | string[] | |
scope.groups | string[] | |
scope.modes | string[] | |
area | string | geofence_exit: each delivery's own area, or zones. One of: dispatch, zones. |
zoneIds | string[] | geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot). |
silentS | integer | Default: 1800. ≥ 120, ≤ 604800. |
idleS | integer | Default: 1200. ≥ 120, ≤ 86400. |
idleRadiusM | integer | Default: 100. ≥ 20, ≤ 5000. |
channels | string[] | Default: ["email","push","webhook"]. |
email | Recipients | |
email.roles | string[] | |
email.userIds | integer[] | Team members (console user ids). |
email.addresses | string (email)[] | Email only: any address. At most 20 items. |
push | Recipients | |
push.roles | string[] | |
push.userIds | integer[] | Team members (console user ids). |
push.addresses | string (email)[] | Email only: any address. At most 20 items. |
quietHours | object | null | Lagos time: emails, pushes and webhooks wait until they end. |
quietHours.from | string | |
quietHours.to | string | |
alarms | string[] | tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation. |
realertS | integer | 0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600. |
createdBy | string | |
createdAt | string (date-time) | |
updatedAt | string (date-time) |
{
"name": "Boats leave their route area",
"kind": "geofence_exit",
"area": "dispatch",
"scope": {
"modes": [
"boat"
]
},
"channels": [
"webhook",
"email",
"push"
],
"email": {
"roles": [
"owner",
"dispatcher"
],
"addresses": [
"ops@example.ng"
]
},
"push": {
"roles": [
"dispatcher"
]
},
"quietHours": {
"from": "22:00",
"to": "06:00"
},
"realertS": 900
}Errors
defaultError
Get a rule
GET https://nways.ng/maps/v1/fleet/alert-rules/{ruleId}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
ruleId | path | string | Required. |
curl "https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
The rule
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | Up to 100 characters. |
kind | string | Required. tracker_alarm: a GPS tracker's alarms (pick which with alarms); without a rule, SOS, power cut, tow and crash go to owners, admins and dispatchers at once and the others once. crash: a driver's phone detected a possible crash and help was sent (N-Ways drivers only during your started deliveries; N-Ways Business riders on duty or on a job). A crash rule only picks assets, channels and recipients; without one, owners, admins and dispatchers get every channel. Quiet hours never hold a crash back. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
active | boolean | Default: true. |
scope | object | Which assets; empty lists = the whole fleet. |
scope.vehicleIds | string[] | |
scope.groups | string[] | |
scope.modes | string[] | |
area | string | geofence_exit: each delivery's own area, or zones. One of: dispatch, zones. |
zoneIds | string[] | geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot). |
silentS | integer | Default: 1800. ≥ 120, ≤ 604800. |
idleS | integer | Default: 1200. ≥ 120, ≤ 86400. |
idleRadiusM | integer | Default: 100. ≥ 20, ≤ 5000. |
channels | string[] | Default: ["email","push","webhook"]. |
email | Recipients | |
email.roles | string[] | |
email.userIds | integer[] | Team members (console user ids). |
email.addresses | string (email)[] | Email only: any address. At most 20 items. |
push | Recipients | |
push.roles | string[] | |
push.userIds | integer[] | Team members (console user ids). |
push.addresses | string (email)[] | Email only: any address. At most 20 items. |
quietHours | object | null | Lagos time: emails, pushes and webhooks wait until they end. |
quietHours.from | string | |
quietHours.to | string | |
alarms | string[] | tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation. |
realertS | integer | 0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600. |
createdBy | string | |
createdAt | string (date-time) | |
updatedAt | string (date-time) |
{
"name": "Boats leave their route area",
"kind": "geofence_exit",
"area": "dispatch",
"scope": {
"modes": [
"boat"
]
},
"channels": [
"webhook",
"email",
"push"
],
"email": {
"roles": [
"owner",
"dispatcher"
],
"addresses": [
"ops@example.ng"
]
},
"push": {
"roles": [
"dispatcher"
]
},
"quietHours": {
"from": "22:00",
"to": "06:00"
},
"realertS": 900
}Errors
defaultError
Change a rule (the kind stays); active false pauses it and resolves its open alerts
PATCH https://nways.ng/maps/v1/fleet/alert-rules/{ruleId}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
ruleId | path | string | Required. |
Request body
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | Up to 100 characters. |
kind | string | Required. tracker_alarm: a GPS tracker's alarms (pick which with alarms); without a rule, SOS, power cut, tow and crash go to owners, admins and dispatchers at once and the others once. crash: a driver's phone detected a possible crash and help was sent (N-Ways drivers only during your started deliveries; N-Ways Business riders on duty or on a job). A crash rule only picks assets, channels and recipients; without one, owners, admins and dispatchers get every channel. Quiet hours never hold a crash back. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
active | boolean | Default: true. |
scope | object | Which assets; empty lists = the whole fleet. |
scope.vehicleIds | string[] | |
scope.groups | string[] | |
scope.modes | string[] | |
area | string | geofence_exit: each delivery's own area, or zones. One of: dispatch, zones. |
zoneIds | string[] | geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot). |
silentS | integer | Default: 1800. ≥ 120, ≤ 604800. |
idleS | integer | Default: 1200. ≥ 120, ≤ 86400. |
idleRadiusM | integer | Default: 100. ≥ 20, ≤ 5000. |
channels | string[] | Default: ["email","push","webhook"]. |
email | Recipients | |
email.roles | string[] | |
email.userIds | integer[] | Team members (console user ids). |
email.addresses | string (email)[] | Email only: any address. At most 20 items. |
push | Recipients | |
push.roles | string[] | |
push.userIds | integer[] | Team members (console user ids). |
push.addresses | string (email)[] | Email only: any address. At most 20 items. |
quietHours | object | null | Lagos time: emails, pushes and webhooks wait until they end. |
quietHours.from | string | |
quietHours.to | string | |
alarms | string[] | tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation. |
realertS | integer | 0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600. |
createdBy | string | |
createdAt | string (date-time) | |
updatedAt | string (date-time) |
curl -X PATCH "https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Boats leave their route area","kind":"geofence_exit","area":"dispatch","scope":{"modes":["boat"]},"channels":["webhook","email","push"],"email":{"roles":["owner","dispatcher"],"addresses":["ops@example.ng"]},"push":{"roles":["dispatcher"]},"quietHours":{"from":"22:00","to":"06:00"},"realertS":900}'const res = await fetch('https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za', {
method: 'PATCH',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "Boats leave their route area",
"kind": "geofence_exit",
"area": "dispatch",
"scope": {
"modes": [
"boat"
]
},
"channels": [
"webhook",
"email",
"push"
],
"email": {
"roles": [
"owner",
"dispatcher"
],
"addresses": [
"ops@example.ng"
]
},
"push": {
"roles": [
"dispatcher"
]
},
"quietHours": {
"from": "22:00",
"to": "06:00"
},
"realertS": 900
}),
})
const data = await res.json()import os
import requests
res = requests.patch(
"https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"name": "Boats leave their route area", "kind": "geofence_exit", "area": "dispatch", "scope": {"modes": ["boat"]}, "channels": ["webhook", "email", "push"], "email": {"roles": ["owner", "dispatcher"], "addresses": ["ops@example.ng"]}, "push": {"roles": ["dispatcher"]}, "quietHours": {"from": "22:00", "to": "06:00"}, "realertS": 900},
timeout=10,
)
data = res.json()Response
The rule
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | Up to 100 characters. |
kind | string | Required. tracker_alarm: a GPS tracker's alarms (pick which with alarms); without a rule, SOS, power cut, tow and crash go to owners, admins and dispatchers at once and the others once. crash: a driver's phone detected a possible crash and help was sent (N-Ways drivers only during your started deliveries; N-Ways Business riders on duty or on a job). A crash rule only picks assets, channels and recipients; without one, owners, admins and dispatchers get every channel. Quiet hours never hold a crash back. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
active | boolean | Default: true. |
scope | object | Which assets; empty lists = the whole fleet. |
scope.vehicleIds | string[] | |
scope.groups | string[] | |
scope.modes | string[] | |
area | string | geofence_exit: each delivery's own area, or zones. One of: dispatch, zones. |
zoneIds | string[] | geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot). |
silentS | integer | Default: 1800. ≥ 120, ≤ 604800. |
idleS | integer | Default: 1200. ≥ 120, ≤ 86400. |
idleRadiusM | integer | Default: 100. ≥ 20, ≤ 5000. |
channels | string[] | Default: ["email","push","webhook"]. |
email | Recipients | |
email.roles | string[] | |
email.userIds | integer[] | Team members (console user ids). |
email.addresses | string (email)[] | Email only: any address. At most 20 items. |
push | Recipients | |
push.roles | string[] | |
push.userIds | integer[] | Team members (console user ids). |
push.addresses | string (email)[] | Email only: any address. At most 20 items. |
quietHours | object | null | Lagos time: emails, pushes and webhooks wait until they end. |
quietHours.from | string | |
quietHours.to | string | |
alarms | string[] | tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation. |
realertS | integer | 0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600. |
createdBy | string | |
createdAt | string (date-time) | |
updatedAt | string (date-time) |
{
"name": "Boats leave their route area",
"kind": "geofence_exit",
"area": "dispatch",
"scope": {
"modes": [
"boat"
]
},
"channels": [
"webhook",
"email",
"push"
],
"email": {
"roles": [
"owner",
"dispatcher"
],
"addresses": [
"ops@example.ng"
]
},
"push": {
"roles": [
"dispatcher"
]
},
"quietHours": {
"from": "22:00",
"to": "06:00"
},
"realertS": 900
}Errors
defaultError
Delete a rule (its open alerts are resolved)
DELETE https://nways.ng/maps/v1/fleet/alert-rules/{ruleId}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
ruleId | path | string | Required. |
curl -X DELETE "https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za', {
method: 'DELETE',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.delete(
"https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
Deleted
No content.
Errors
defaultError
Alerts raised, newest first
GET https://nways.ng/maps/v1/fleet/alert-events
Parameters
| Name | In | Type | Description |
|---|---|---|---|
state | query | string | active = open or acknowledged. One of: open, acknowledged, resolved, active. |
vehicleId | query | string | |
kind | query | string | One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
limit | query | integer | Default: 100. ≥ 1, ≤ 500. |
pageToken | query | string |
curl "https://nways.ng/maps/v1/fleet/alert-events" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/alert-events', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/alert-events",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
Alerts
| Field | Type | Description |
|---|---|---|
alerts | AlertEvent[] | Required. |
alerts[].id | string | Required. |
alerts[].ruleId | string | Required. A rule id, or default:dispatch for a delivery area with no rule of its own, default:crash for a crash with no crash rule. |
alerts[].ruleName | string | |
alerts[].kind | string | Required. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
alerts[].vehicleId | string | Required. |
alerts[].vehicleName | string | |
alerts[].subject | string | task:<id> or zone:<id> for geofences; crash:<crs_id> for a crash. |
alerts[].state | string | Required. One of: open, acknowledged, resolved. |
alerts[].detail | object | Required. position, at, taskId, area, zoneId, zoneName, lastSeenAt, since…; a crash: crashId, at, position, accuracyM, speedBeforeKmh, road, driverName, driverPhone (when you have it), taskId, taskRef, taskLabel, state (help | resolved), resolvedHow (ok | help_here). |
alerts[].startedAt | string (date-time) | Required. |
alerts[].notifiedAt | string (date-time) | null | |
alerts[].notifications | integer | |
alerts[].acknowledgedBy | string | |
alerts[].acknowledgedAt | string (date-time) | null | |
alerts[].resolvedBy | string | |
alerts[].resolvedAt | string (date-time) | null | |
alerts[].autoResolved | boolean | Cleared by itself (back inside, heard from again, moving). |
nextPageToken | string |
{
"alerts": [
{
"id": "alr_8KwP2nVd5T",
"ruleId": "string",
"ruleName": "string",
"kind": "geofence_exit",
"vehicleId": "string",
"vehicleName": "string",
"subject": "string",
"state": "open",
"detail": {},
"startedAt": "2026-10-15T09:00:00+01:00",
"notifiedAt": "2026-10-15T09:00:00+01:00",
"notifications": 0,
"acknowledgedBy": "string",
"acknowledgedAt": "2026-10-15T09:00:00+01:00",
"resolvedBy": "string",
"resolvedAt": "2026-10-15T09:00:00+01:00",
"autoResolved": true
}
],
"nextPageToken": "string"
}Errors
defaultError
Get an alert
GET https://nways.ng/maps/v1/fleet/alert-events/{alertId}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
alertId | path | string | Required. |
curl "https://nways.ng/maps/v1/fleet/alert-events/alr_8KwP2nVd5T" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/alert-events/alr_8KwP2nVd5T', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/alert-events/alr_8KwP2nVd5T",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
The alert
| Field | Type | Description |
|---|---|---|
id | string | Required. |
ruleId | string | Required. A rule id, or default:dispatch for a delivery area with no rule of its own, default:crash for a crash with no crash rule. |
ruleName | string | |
kind | string | Required. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
vehicleId | string | Required. |
vehicleName | string | |
subject | string | task:<id> or zone:<id> for geofences; crash:<crs_id> for a crash. |
state | string | Required. One of: open, acknowledged, resolved. |
detail | object | Required. position, at, taskId, area, zoneId, zoneName, lastSeenAt, since…; a crash: crashId, at, position, accuracyM, speedBeforeKmh, road, driverName, driverPhone (when you have it), taskId, taskRef, taskLabel, state (help | resolved), resolvedHow (ok | help_here). |
startedAt | string (date-time) | Required. |
notifiedAt | string (date-time) | null | |
notifications | integer | |
acknowledgedBy | string | |
acknowledgedAt | string (date-time) | null | |
resolvedBy | string | |
resolvedAt | string (date-time) | null | |
autoResolved | boolean | Cleared by itself (back inside, heard from again, moving). |
{
"id": "alr_8KwP2nVd5T",
"ruleId": "string",
"ruleName": "string",
"kind": "geofence_exit",
"vehicleId": "string",
"vehicleName": "string",
"subject": "string",
"state": "open",
"detail": {},
"startedAt": "2026-10-15T09:00:00+01:00",
"notifiedAt": "2026-10-15T09:00:00+01:00",
"notifications": 0,
"acknowledgedBy": "string",
"acknowledgedAt": "2026-10-15T09:00:00+01:00",
"resolvedBy": "string",
"resolvedAt": "2026-10-15T09:00:00+01:00",
"autoResolved": true
}Errors
defaultError
Acknowledge an open alert (no more reminders; it stays until it clears or is resolved)
POST https://nways.ng/maps/v1/fleet/alert-events/{alertId}/acknowledge
Parameters
| Name | In | Type | Description |
|---|---|---|---|
alertId | path | string | Required. |
curl -X POST "https://nways.ng/maps/v1/fleet/alert-events/string/acknowledge" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/alert-events/string/acknowledge', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/alert-events/string/acknowledge",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
The alert
| Field | Type | Description |
|---|---|---|
id | string | Required. |
ruleId | string | Required. A rule id, or default:dispatch for a delivery area with no rule of its own, default:crash for a crash with no crash rule. |
ruleName | string | |
kind | string | Required. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
vehicleId | string | Required. |
vehicleName | string | |
subject | string | task:<id> or zone:<id> for geofences; crash:<crs_id> for a crash. |
state | string | Required. One of: open, acknowledged, resolved. |
detail | object | Required. position, at, taskId, area, zoneId, zoneName, lastSeenAt, since…; a crash: crashId, at, position, accuracyM, speedBeforeKmh, road, driverName, driverPhone (when you have it), taskId, taskRef, taskLabel, state (help | resolved), resolvedHow (ok | help_here). |
startedAt | string (date-time) | Required. |
notifiedAt | string (date-time) | null | |
notifications | integer | |
acknowledgedBy | string | |
acknowledgedAt | string (date-time) | null | |
resolvedBy | string | |
resolvedAt | string (date-time) | null | |
autoResolved | boolean | Cleared by itself (back inside, heard from again, moving). |
{
"id": "alr_8KwP2nVd5T",
"ruleId": "string",
"ruleName": "string",
"kind": "geofence_exit",
"vehicleId": "string",
"vehicleName": "string",
"subject": "string",
"state": "open",
"detail": {},
"startedAt": "2026-10-15T09:00:00+01:00",
"notifiedAt": "2026-10-15T09:00:00+01:00",
"notifications": 0,
"acknowledgedBy": "string",
"acknowledgedAt": "2026-10-15T09:00:00+01:00",
"resolvedBy": "string",
"resolvedAt": "2026-10-15T09:00:00+01:00",
"autoResolved": true
}Errors
defaultError
Resolve an alert (sends asset.alert_resolved)
POST https://nways.ng/maps/v1/fleet/alert-events/{alertId}/resolve
Parameters
| Name | In | Type | Description |
|---|---|---|---|
alertId | path | string | Required. |
curl -X POST "https://nways.ng/maps/v1/fleet/alert-events/string/resolve" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/alert-events/string/resolve', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/alert-events/string/resolve",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
The alert
| Field | Type | Description |
|---|---|---|
id | string | Required. |
ruleId | string | Required. A rule id, or default:dispatch for a delivery area with no rule of its own, default:crash for a crash with no crash rule. |
ruleName | string | |
kind | string | Required. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm. |
vehicleId | string | Required. |
vehicleName | string | |
subject | string | task:<id> or zone:<id> for geofences; crash:<crs_id> for a crash. |
state | string | Required. One of: open, acknowledged, resolved. |
detail | object | Required. position, at, taskId, area, zoneId, zoneName, lastSeenAt, since…; a crash: crashId, at, position, accuracyM, speedBeforeKmh, road, driverName, driverPhone (when you have it), taskId, taskRef, taskLabel, state (help | resolved), resolvedHow (ok | help_here). |
startedAt | string (date-time) | Required. |
notifiedAt | string (date-time) | null | |
notifications | integer | |
acknowledgedBy | string | |
acknowledgedAt | string (date-time) | null | |
resolvedBy | string | |
resolvedAt | string (date-time) | null | |
autoResolved | boolean | Cleared by itself (back inside, heard from again, moving). |
{
"id": "alr_8KwP2nVd5T",
"ruleId": "string",
"ruleName": "string",
"kind": "geofence_exit",
"vehicleId": "string",
"vehicleName": "string",
"subject": "string",
"state": "open",
"detail": {},
"startedAt": "2026-10-15T09:00:00+01:00",
"notifiedAt": "2026-10-15T09:00:00+01:00",
"notifications": 0,
"acknowledgedBy": "string",
"acknowledgedAt": "2026-10-15T09:00:00+01:00",
"resolvedBy": "string",
"resolvedAt": "2026-10-15T09:00:00+01:00",
"autoResolved": true
}Errors
defaultError
Download every event (CSV for Excel or Google Sheets, or JSON)
GET https://nways.ng/maps/v1/fleet/events/export
The same payloads webhooks get, kept as long as your history (retentionDays). At most 100,000 per download.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
format | query | string | One of: csv, json. Default: csv. |
from | query | string | RFC 3339, or YYYY-MM-DD (Lagos day). |
to | query | string | |
type | query | string | A prefix: asset. or task. |
curl "https://nways.ng/maps/v1/fleet/events/export" \
-H "X-NWays-Api-Key: YOUR_API_KEY"const res = await fetch('https://nways.ng/maps/v1/fleet/events/export', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/events/export",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
The events
Errors
defaultError