An alert is a rule you configure. An event is one firing of that rule.
5.1 GET /api/get_events — the historical log, paginated
curl 'https://myfleet.sawatelematics.com/api/get_events?\
from_date=2026-10-05&to_date=2026-10-07&limit=50&page=1' \
-H 'Authorization: Bearer sk_live_…'
{
"status": 1,
"items": {
"current_page": 1,
"data": [
{
"id": 6643431,
"device_id": 866,
"device_name": "RAG 505K",
"type": "overspeed",
"name": "Overspeed",
"message": "Overspeed (60 kph)",
"detail": "60 kph",
"time": "2026-10-07 10:34:58",
"latitude": -3.7583483,
"longitude": 39.6683733,
"speed": 63,
"altitude": 184,
"course": 228,
"alert_id": 264,
"position_id": 901095,
"geofence_id": null,
"additional": { "overspeed_speed": 60 },
"created_at": "2026-10-07 08:35:00"
}
]
}
}
Note time (local, 10:34:58) against created_at (UTC, 08:35:00) in the same
object — §3.1 in one row.
Standard Laravel pagination: current_page, data, plus last_page, total,
per_page.
5.2 GET /api/v2/events/since — incremental polling
The endpoint to build a live event feed on. Lean payload, no pagination.
curl 'https://myfleet.sawatelematics.com/api/v2/events/since?minutes=60' \
-H 'Authorization: Bearer sk_live_…'
{
"status": 1,
"events": [
{ "id": 6643239, "device_id": 38, "device_name": "RAG 687G",
"type": "idle_duration", "message": "", "time": "2026-10-07 07:37:05",
"lat": -2.1200199, "lng": 29.32346, "speed": 12,
"geofence_id": null, "alert_id": 242 }
]
}
Poll this on a minutes window slightly larger than your interval — poll
every 60 s with minutes=2 — then de-duplicate on id. Events are written a
few seconds after the position that triggered them, so an exactly-matching
window drops events at the boundary.
5.3 Event types
From GET /api/get_alerts_summary, which also returns lifetime counts per type:
type |
Title |
|---|---|
overspeed |
Overspeed |
stop_duration |
Stop duration |
offline_duration |
Offline duration |
ignition_duration |
Ignition duration |
idle_duration |
Idle duration |
ignition |
Ignition ON/OFF |
move_start |
Start of movement |
driver |
Driver change |
driver_unauthorized |
Driver change authorization |
geofence_in / geofence_out / geofence_inout |
Geofence enter / exit / either |
fuel_change |
Fuel fill or drain beyond threshold |
distance |
Distance threshold |
custom |
Device protocol event (panic, SOS, …) |
task_status |
Driver task status change |
{ "status": 1, "items": [ { "type": "overspeed", "title": "Overspeed",
"count": 251603 } ] }
5.4 Marking events seen
| Endpoint | Purpose |
|---|---|
GET /api/v2/events/unseen |
Count/list not yet acknowledged |
POST /api/v2/events/seen |
Acknowledge |
Per-user state. Useful if your client is a dashboard; ignore it if you are piping events into another system.
5.5 Managing the rules
| Method | Path | Purpose |
|---|---|---|
ANY |
/api/get_alerts |
List configured alerts |
ANY |
/api/add_alert |
Create |
ANY |
/api/edit_alert |
Update |
ANY |
/api/set_alert_devices |
Attach vehicles to an alert |
ANY |
/api/change_active_alert |
Enable / disable |
ANY |
/api/destroy_alert |
Delete |
recipient_warnings (since 14 Nov 2026) is on every rule get_alerts returns: the rule's email recipients the
platform has stopped emailing, or soon will. [] when nothing is wrong.
"recipient_warnings": [ { "address": "ops@example.com", "state": "paused", "reason": "bouncing",
"since": "2026-11-20T07:58:47Z",
"text": "Emails to this address keep bouncing, so they are paused. Correct the address, then ask support to resume it." } ]
state |
Meaning |
|---|---|
paused |
No email goes to this address until Sawa support resumes it (reason: bouncing or paused by an administrator) |
bouncing |
Email to it keeps bouncing; it will be paused once the bounce pause is enforced |
Show text beside the recipient in the rule editor, so the account can correct the address.
Switching a rule on or off, and deleting it, are its owner's alone (or the owner's manager's): change_active_alert
and destroy_alert on anyone else's rule answer 403 (since 14 Nov 2026).
5.6 Team rules — a manager's rule that reaches their users
Live since 14 Nov 2026. Team rules start observed on the platform: until a manager is piloted or the switch is on,
they alert the manager only and GET v2/alerts/team is empty.
A team rule is a manager's ordinary rule with scope: "team". It fires on the vehicles the manager put on it, and
each alert also reaches the manager's direct users who can see that vehicle. A user who also has a matching rule of
their own gets one notification, not two. Users can't edit, switch off or delete a team rule.
Who can: managers (group 3) only, and only on vehicles linked to them. Recipients are their direct users. The
platform switch (team_rules) may hold team rules in observation: they then alert the manager only, as an own rule
would, while their reach is measured; GET v2/alerts/team is empty meanwhile.
add_alert_data (and edit_alert_data) gain team:
"team": { "allowed": true,
"users": [ { "id": 813, "name": "Dispatch Kigali", "vehicles": 12 } ],
"vehicles": [ 5012, 5013, 5014 ] }
allowed is false for anyone else, with users and vehicles empty. users[].vehicles counts the manager's vehicles
each user can see. While the team switch is on in the editor, offer only team.vehicles in the vehicle picker.
add_alert, edit_alert take, optionally:
| Parameter | Values | Default |
|---|---|---|
scope |
own, team |
own |
recipients |
all, or an array of user ids (the manager's direct users) |
all |
notify_owner |
1, 0 — "notify me too" |
1 |
recipients_email |
1, 0 — each recipient also gets the alert by email, to their account's address |
0 |
recipients_sms |
1, 0 — each recipient also gets it by SMS, to their account's number |
0 |
An edit_alert that doesn't send scope leaves the team settings as they are, so an older client can still edit a
team rule. Refusals are 400, status: 0:
| Field | errors.<field> |
Meaning |
|---|---|---|
scope |
["team_not_allowed"] |
the account isn't a manager (or team rules are switched off) |
devices |
["vehicles_not_yours"] |
a vehicle isn't linked to the manager (also on set_alert_devices for a team rule) |
recipients |
["not_your_users"] |
an id isn't one of the manager's direct users |
get_alerts rows gain scope, recipients ("all", ids, or null for an own rule), recipients_count (the
users it reaches now: chosen, active, and seeing at least one of its vehicles), notify_owner, recipients_email and
recipients_sms.
What each recipient receives: the alert in their event list and the app always; push when the rule has push on; email
or SMS of their own only when the rule asks (recipients_email, recipients_sms). Webhooks, device commands and the
addresses typed on the rule fire once, from the manager's rule. With notify_owner: 0 the manager's own copy is kept
for the rule's history (get_events?alert_id=) but stays out of their live feed and push.
GET /api/v2/alerts/team — the team rules that reach the signed-in user. Not cached.
{ "status": 1, "data": [
{ "id": 880, "name": "Overspeed 80", "type": "overspeed", "active": true,
"set_by": { "id": 120, "name": "Kigali Movers" },
"vehicles": [5012, 5013],
"channels": { "in_app": true, "push": true, "email": false, "sms": false },
"schedule": { "always": true } } ] }
vehicles lists only those this user can see; channels is what this user receives (sms is false without a phone
number on the account).
Events from a team rule carry team, in get_events (§5.1) and v2/events/since (§5.2); it is null for the
user's own rules:
"team": { "set_by": { "id": 120, "name": "Kigali Movers" } }
Show "Set by <name>" and no edit link on those.
5.7 Push tokens, and push notifications
POST /api/fcm_token takes an optional provider: fcm (default) or expo. Sawa Fleet registers its Expo token
with { "token": "ExponentPushToken[…]", "platform": "ios", "app_version": "1.1.0", "provider": "expo" }. A
provider that doesn't match the token is a 400 (errors.provider). fcm_token_remove is unchanged.
Once the platform's push is switched on (P3, live since 14 Nov 2026 but switched off), alert notifications carry data.event_id,
data.device_id, data.alert_id, data.type, and data.team for a team rule's alert: a tap opens the alert.
5.8 GET /api/v2/announcements
Live since 14 Nov 2026. The announcements showing to the signed-in account, newest first:
{ "status": 1, "data": [ { "id": 7, "title": "Planned maintenance", "text": "Saturday 02:00–03:00 the map may be unavailable.",
"link": null, "level": "info", "until": "2026-12-06T03:00:00Z" } ] }
level is info or warning. Show a dismissible banner and remember dismissals on the device; the server keeps no
read state. Poll on sign-in and every 10 minutes.