N-Ways
Developer docsAlerts and export

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
Note:

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
curl "https://nways.ng/maps/v1/fleet/alert-rules" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

FieldTypeDescription
rulesAlertRule[]Required.
rules[].idstring
rules[].namestringUp to 100 characters.
rules[].kindstringRequired. 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[].activebooleanDefault: true.
rules[].scopeobjectWhich assets; empty lists = the whole fleet.
rules[].scope.vehicleIdsstring[]
rules[].scope.groupsstring[]
rules[].scope.modesstring[]
rules[].areastringgeofence_exit: each delivery's own area, or zones. One of: dispatch, zones.
rules[].zoneIdsstring[]geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot).
rules[].silentSintegerDefault: 1800. ≥ 120, ≤ 604800.
rules[].idleSintegerDefault: 1200. ≥ 120, ≤ 86400.
rules[].idleRadiusMintegerDefault: 100. ≥ 20, ≤ 5000.
rules[].channelsstring[]Default: ["email","push","webhook"].
rules[].emailRecipients
rules[].email.rolesstring[]
rules[].email.userIdsinteger[]Team members (console user ids).
rules[].email.addressesstring (email)[]Email only: any address. At most 20 items.
rules[].pushRecipients
rules[].push.rolesstring[]
rules[].push.userIdsinteger[]Team members (console user ids).
rules[].push.addressesstring (email)[]Email only: any address. At most 20 items.
rules[].quietHoursobject | nullLagos time: emails, pushes and webhooks wait until they end.
rules[].quietHours.fromstring
rules[].quietHours.tostring
rules[].alarmsstring[]tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation.
rules[].realertSinteger0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600.
rules[].createdBystring
rules[].createdAtstring (date-time)
rules[].updatedAtstring (date-time)
200 OK
{
  "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

  • default Error

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

FieldTypeDescription
idstring
namestringUp to 100 characters.
kindstringRequired. 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.
activebooleanDefault: true.
scopeobjectWhich assets; empty lists = the whole fleet.
scope.vehicleIdsstring[]
scope.groupsstring[]
scope.modesstring[]
areastringgeofence_exit: each delivery's own area, or zones. One of: dispatch, zones.
zoneIdsstring[]geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot).
silentSintegerDefault: 1800. ≥ 120, ≤ 604800.
idleSintegerDefault: 1200. ≥ 120, ≤ 86400.
idleRadiusMintegerDefault: 100. ≥ 20, ≤ 5000.
channelsstring[]Default: ["email","push","webhook"].
emailRecipients
email.rolesstring[]
email.userIdsinteger[]Team members (console user ids).
email.addressesstring (email)[]Email only: any address. At most 20 items.
pushRecipients
push.rolesstring[]
push.userIdsinteger[]Team members (console user ids).
push.addressesstring (email)[]Email only: any address. At most 20 items.
quietHoursobject | nullLagos time: emails, pushes and webhooks wait until they end.
quietHours.fromstring
quietHours.tostring
alarmsstring[]tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation.
realertSinteger0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600.
createdBystring
createdAtstring (date-time)
updatedAtstring (date-time)
cURL
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}'
JavaScript
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()
Python
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

FieldTypeDescription
idstring
namestringUp to 100 characters.
kindstringRequired. 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.
activebooleanDefault: true.
scopeobjectWhich assets; empty lists = the whole fleet.
scope.vehicleIdsstring[]
scope.groupsstring[]
scope.modesstring[]
areastringgeofence_exit: each delivery's own area, or zones. One of: dispatch, zones.
zoneIdsstring[]geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot).
silentSintegerDefault: 1800. ≥ 120, ≤ 604800.
idleSintegerDefault: 1200. ≥ 120, ≤ 86400.
idleRadiusMintegerDefault: 100. ≥ 20, ≤ 5000.
channelsstring[]Default: ["email","push","webhook"].
emailRecipients
email.rolesstring[]
email.userIdsinteger[]Team members (console user ids).
email.addressesstring (email)[]Email only: any address. At most 20 items.
pushRecipients
push.rolesstring[]
push.userIdsinteger[]Team members (console user ids).
push.addressesstring (email)[]Email only: any address. At most 20 items.
quietHoursobject | nullLagos time: emails, pushes and webhooks wait until they end.
quietHours.fromstring
quietHours.tostring
alarmsstring[]tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation.
realertSinteger0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600.
createdBystring
createdAtstring (date-time)
updatedAtstring (date-time)
201 OK
{
  "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

  • default Error

Get a rule

GET https://nways.ng/maps/v1/fleet/alert-rules/{ruleId}

Parameters

NameInTypeDescription
ruleIdpathstringRequired.
cURL
curl "https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

FieldTypeDescription
idstring
namestringUp to 100 characters.
kindstringRequired. 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.
activebooleanDefault: true.
scopeobjectWhich assets; empty lists = the whole fleet.
scope.vehicleIdsstring[]
scope.groupsstring[]
scope.modesstring[]
areastringgeofence_exit: each delivery's own area, or zones. One of: dispatch, zones.
zoneIdsstring[]geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot).
silentSintegerDefault: 1800. ≥ 120, ≤ 604800.
idleSintegerDefault: 1200. ≥ 120, ≤ 86400.
idleRadiusMintegerDefault: 100. ≥ 20, ≤ 5000.
channelsstring[]Default: ["email","push","webhook"].
emailRecipients
email.rolesstring[]
email.userIdsinteger[]Team members (console user ids).
email.addressesstring (email)[]Email only: any address. At most 20 items.
pushRecipients
push.rolesstring[]
push.userIdsinteger[]Team members (console user ids).
push.addressesstring (email)[]Email only: any address. At most 20 items.
quietHoursobject | nullLagos time: emails, pushes and webhooks wait until they end.
quietHours.fromstring
quietHours.tostring
alarmsstring[]tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation.
realertSinteger0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600.
createdBystring
createdAtstring (date-time)
updatedAtstring (date-time)
200 OK
{
  "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

  • default Error

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

NameInTypeDescription
ruleIdpathstringRequired.

Request body

FieldTypeDescription
idstring
namestringUp to 100 characters.
kindstringRequired. 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.
activebooleanDefault: true.
scopeobjectWhich assets; empty lists = the whole fleet.
scope.vehicleIdsstring[]
scope.groupsstring[]
scope.modesstring[]
areastringgeofence_exit: each delivery's own area, or zones. One of: dispatch, zones.
zoneIdsstring[]geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot).
silentSintegerDefault: 1800. ≥ 120, ≤ 604800.
idleSintegerDefault: 1200. ≥ 120, ≤ 86400.
idleRadiusMintegerDefault: 100. ≥ 20, ≤ 5000.
channelsstring[]Default: ["email","push","webhook"].
emailRecipients
email.rolesstring[]
email.userIdsinteger[]Team members (console user ids).
email.addressesstring (email)[]Email only: any address. At most 20 items.
pushRecipients
push.rolesstring[]
push.userIdsinteger[]Team members (console user ids).
push.addressesstring (email)[]Email only: any address. At most 20 items.
quietHoursobject | nullLagos time: emails, pushes and webhooks wait until they end.
quietHours.fromstring
quietHours.tostring
alarmsstring[]tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation.
realertSinteger0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600.
createdBystring
createdAtstring (date-time)
updatedAtstring (date-time)
cURL
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}'
JavaScript
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()
Python
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

FieldTypeDescription
idstring
namestringUp to 100 characters.
kindstringRequired. 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.
activebooleanDefault: true.
scopeobjectWhich assets; empty lists = the whole fleet.
scope.vehicleIdsstring[]
scope.groupsstring[]
scope.modesstring[]
areastringgeofence_exit: each delivery's own area, or zones. One of: dispatch, zones.
zoneIdsstring[]geofence_*: which zones (empty = all); idle: zones where stopping is fine (a depot).
silentSintegerDefault: 1800. ≥ 120, ≤ 604800.
idleSintegerDefault: 1200. ≥ 120, ≤ 86400.
idleRadiusMintegerDefault: 100. ≥ 20, ≤ 5000.
channelsstring[]Default: ["email","push","webhook"].
emailRecipients
email.rolesstring[]
email.userIdsinteger[]Team members (console user ids).
email.addressesstring (email)[]Email only: any address. At most 20 items.
pushRecipients
push.rolesstring[]
push.userIdsinteger[]Team members (console user ids).
push.addressesstring (email)[]Email only: any address. At most 20 items.
quietHoursobject | nullLagos time: emails, pushes and webhooks wait until they end.
quietHours.fromstring
quietHours.tostring
alarmsstring[]tracker_alarm: which alarms (empty = all). transferred: the tracker moved to another organisation.
realertSinteger0 = tell once; else remind every realertS (300–86400) until acknowledged, at most 10 times. Default: 3600.
createdBystring
createdAtstring (date-time)
updatedAtstring (date-time)
200 OK
{
  "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

  • default Error

Delete a rule (its open alerts are resolved)

DELETE https://nways.ng/maps/v1/fleet/alert-rules/{ruleId}

Parameters

NameInTypeDescription
ruleIdpathstringRequired.
cURL
curl -X DELETE "https://nways.ng/maps/v1/fleet/alert-rules/rule_4fQ9xLm2Za" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

  • default Error

Alerts raised, newest first

GET https://nways.ng/maps/v1/fleet/alert-events

Parameters

NameInTypeDescription
statequerystringactive = open or acknowledged. One of: open, acknowledged, resolved, active.
vehicleIdquerystring
kindquerystringOne of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm.
limitqueryintegerDefault: 100. ≥ 1, ≤ 500.
pageTokenquerystring
cURL
curl "https://nways.ng/maps/v1/fleet/alert-events" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

FieldTypeDescription
alertsAlertEvent[]Required.
alerts[].idstringRequired.
alerts[].ruleIdstringRequired. 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[].ruleNamestring
alerts[].kindstringRequired. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm.
alerts[].vehicleIdstringRequired.
alerts[].vehicleNamestring
alerts[].subjectstringtask:<id> or zone:<id> for geofences; crash:<crs_id> for a crash.
alerts[].statestringRequired. One of: open, acknowledged, resolved.
alerts[].detailobjectRequired. 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[].startedAtstring (date-time)Required.
alerts[].notifiedAtstring (date-time) | null
alerts[].notificationsinteger
alerts[].acknowledgedBystring
alerts[].acknowledgedAtstring (date-time) | null
alerts[].resolvedBystring
alerts[].resolvedAtstring (date-time) | null
alerts[].autoResolvedbooleanCleared by itself (back inside, heard from again, moving).
nextPageTokenstring
200 OK
{
  "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

  • default Error

Get an alert

GET https://nways.ng/maps/v1/fleet/alert-events/{alertId}

Parameters

NameInTypeDescription
alertIdpathstringRequired.
cURL
curl "https://nways.ng/maps/v1/fleet/alert-events/alr_8KwP2nVd5T" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

FieldTypeDescription
idstringRequired.
ruleIdstringRequired. 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.
ruleNamestring
kindstringRequired. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm.
vehicleIdstringRequired.
vehicleNamestring
subjectstringtask:<id> or zone:<id> for geofences; crash:<crs_id> for a crash.
statestringRequired. One of: open, acknowledged, resolved.
detailobjectRequired. 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).
startedAtstring (date-time)Required.
notifiedAtstring (date-time) | null
notificationsinteger
acknowledgedBystring
acknowledgedAtstring (date-time) | null
resolvedBystring
resolvedAtstring (date-time) | null
autoResolvedbooleanCleared by itself (back inside, heard from again, moving).
200 OK
{
  "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

  • default Error

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

NameInTypeDescription
alertIdpathstringRequired.
cURL
curl -X POST "https://nways.ng/maps/v1/fleet/alert-events/string/acknowledge" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

FieldTypeDescription
idstringRequired.
ruleIdstringRequired. 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.
ruleNamestring
kindstringRequired. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm.
vehicleIdstringRequired.
vehicleNamestring
subjectstringtask:<id> or zone:<id> for geofences; crash:<crs_id> for a crash.
statestringRequired. One of: open, acknowledged, resolved.
detailobjectRequired. 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).
startedAtstring (date-time)Required.
notifiedAtstring (date-time) | null
notificationsinteger
acknowledgedBystring
acknowledgedAtstring (date-time) | null
resolvedBystring
resolvedAtstring (date-time) | null
autoResolvedbooleanCleared by itself (back inside, heard from again, moving).
200 OK
{
  "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

  • default Error

Resolve an alert (sends asset.alert_resolved)

POST https://nways.ng/maps/v1/fleet/alert-events/{alertId}/resolve

Parameters

NameInTypeDescription
alertIdpathstringRequired.
cURL
curl -X POST "https://nways.ng/maps/v1/fleet/alert-events/string/resolve" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

FieldTypeDescription
idstringRequired.
ruleIdstringRequired. 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.
ruleNamestring
kindstringRequired. One of: geofence_exit, geofence_enter, silent, idle, crash, tracker_alarm.
vehicleIdstringRequired.
vehicleNamestring
subjectstringtask:<id> or zone:<id> for geofences; crash:<crs_id> for a crash.
statestringRequired. One of: open, acknowledged, resolved.
detailobjectRequired. 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).
startedAtstring (date-time)Required.
notifiedAtstring (date-time) | null
notificationsinteger
acknowledgedBystring
acknowledgedAtstring (date-time) | null
resolvedBystring
resolvedAtstring (date-time) | null
autoResolvedbooleanCleared by itself (back inside, heard from again, moving).
200 OK
{
  "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

  • default Error

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

NameInTypeDescription
formatquerystringOne of: csv, json. Default: csv.
fromquerystringRFC 3339, or YYYY-MM-DD (Lagos day).
toquerystring
typequerystringA prefix: asset. or task.
cURL
curl "https://nways.ng/maps/v1/fleet/events/export" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
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()
Python
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

  • default Error