Two endpoints, with very different costs.
4.1 GET /api/get_devices_latest — use this one
The live-state feed. One flat list, current position and status per vehicle.
curl 'https://myfleet.sawatelematics.com/api/get_devices_latest' \
-H 'Authorization: Bearer sk_live_…'
{
"items": [
{
"id": 17,
"name": "Truck 04",
"plate_number": "RAA 000A",
"imei": "35xxxxxxxxxxx17",
"group_id": 211,
"device_model": "FAW",
"vehicle_type": "ICE",
"online": "online",
"time": "2026-10-07 10:35:48",
"timestamp": 1791362151,
"lat": -1.261303,
"lng": 30.024918,
"course": 100,
"speed": 31,
"altitude": 1800,
"protocol": "teltonika",
"icon_color": "green",
"icon_colors": { "moving": "green", "stopped": "yellow",
"offline": "red", "engine": "yellow" }
}
]
}
online is the status field you want:
| Value | Meaning |
|---|---|
online |
Reporting now |
ack |
Connected, last fix acknowledged but stale |
offline |
Past the account's offline timeout |
Measured size on an account with 917 vehicles: 1.3 MB.
owned_by_me (boolean, since 14 Nov 2026) is on every row of get_devices_latest and get_devices: whether the
signed-in account is the vehicle's owner. An owner always keeps access to their own vehicle, so removing one from
your own account (detach_device) is refused for an owner with 400 and
errors.device = ["You own this vehicle; transfer it to its new owner first."]. Hide "remove from my account" on
rows where owned_by_me is true. Other users can still remove a vehicle shared with them.
4.2 GET /api/get_devices — the grouped tree, and it is large
Same vehicles, nested under device groups, with sensors and shared-user relations expanded.
[ { "id": "", "title": "Ungrouped", "items": [ { "id": 1531, … } ] } ]
Measured size on the same account: 10.3 MB — eight times the flat feed, for the same positions. Use it when you need the group tree; do not poll it.
?page=and?limit=are accepted but did not reduce the payload in testing. Treatget_devicesas all-or-nothing.
4.3 Polling cadence
Positions arrive from devices roughly every 5–30 seconds depending on the vehicle's configuration and whether it is moving.
- Poll
get_devices_latestno faster than every 10 seconds. Faster gains nothing and costs both sides. - Responses may be served from a 300 s cache (
API_RESPONSE_CACHE_ENABLED);timestamptells you how fresh the data genuinely is.
4.4 Realtime push instead of polling
A Socket.IO server is reachable on port 9001 and is open to the internet
(verified: GET :9001/socket.io/?EIO=3&transport=polling → 200).
const socket = io('http://myfleet.sawatelematics.com:9001');
socket.emit('join', userChannel); // the channel for the authenticated user
socket.on('notice', msg => { /* toasts: success / error / info / warning */ });
It is a notification channel — alert toasts and camera events — not a
position firehose. For positions, poll get_devices_latest. The channel name
comes from the authenticated session; a server-to-server integration generally
wants polling.
4.5 A single vehicle
| Endpoint | Returns |
|---|---|
GET /api/get_devices_by_group/{group_id} |
Vehicles in one group, with sensors |
GET /api/eta/vehicle_position/{vehicle_id} |
Position for one ETA-tracked vehicle |