REST API for real-time GPS fleet tracking, geofence management, and travel monitoring.
All requests require a valid API key. You can generate and manage keys from Settings → API.
Include the key in the Authorization header with the Bearer prefix:
Authorization: Bearer gps_your_api_key_here
Alternatively, you may use the X-Api-Key header:
X-Api-Key: gps_your_api_key_here
https://platform.gpsafe.io/api/v1
All endpoint paths documented below are relative to this base URL.
The API uses conventional HTTP status codes to indicate the outcome of each request.
| Code | Meaning |
|---|---|
200 | Success — response data is available in the data field |
400 | Bad Request — invalid parameters or business rule violation |
401 | Unauthorized — API key is missing, invalid, or expired |
404 | Not Found — the requested resource does not exist |
429 | Too Many Requests — rate limit exceeded (50 requests / 10 seconds) |
500 | Internal Server Error — unexpected server-side failure |
All responses share this envelope structure:
{
"success": true | false,
"data": { ... } | [ ... ] | null,
"error": null | "Error description",
"timestamp": "2026-03-10T15:30:00Z"
}
Returns the latest status of all devices accessible by the authenticated API key, including location, speed, engine state, and connectivity information.
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer {api_key} |
None.
curl -H "Authorization: Bearer gps_your_key" \
https://platform.gpsafe.io/api/v1/devices/status
200 OK{
"success": true,
"data": [
{
"deviceId": "350612345678901",
"name": "TOYOTA HILUX",
"plates": "ABC1234",
"status": "Moving",
"engineStatus": "On",
"latitude": 19.432608,
"longitude": -99.133209,
"address": "Av. Reforma 222, CDMX",
"speedKmh": 45,
"heading": 270,
"odometerKm": 128450.3,
"satellites": 12,
"powerVoltage": "13.8",
"backupVoltage": "4.1",
"signalStrength": 28,
"connectionType": "4G",
"lastReportUtc": "2026-03-10T15:28:44Z",
"minutesSinceReport": 2
}
],
"timestamp": "2026-03-10T15:30:00Z"
}
| Field | Type | Description |
|---|---|---|
deviceId | string | Device IMEI (unique identifier) |
name | string | Vehicle name |
plates | string | License plate number |
status | string | Moving · Stopped · Inactive · Off |
engineStatus | string | On · Off (ignition state) |
latitude | decimal? | GPS latitude |
longitude | decimal? | GPS longitude |
address | string? | Reverse-geocoded address |
speedKmh | int? | Current speed in km/h |
heading | int? | Bearing in degrees (0–360) |
odometerKm | double? | Odometer reading in kilometers |
satellites | int? | Number of GPS satellites in view |
powerVoltage | string? | Vehicle power supply voltage |
backupVoltage | string? | Backup battery voltage |
signalStrength | int? | GSM signal strength (0–31) |
connectionType | string? | Network type (2G, 3G, 4G) |
lastReportUtc | datetime? | Timestamp of the last report (UTC) |
minutesSinceReport | int? | Minutes elapsed since the last report |
Returns the latest status of a single device, identified by its IMEI (deviceId). The response fields are the same as the list endpoint above.
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer {api_key} |
| Parameter | Type | Required | Description |
|---|---|---|---|
deviceId | string | Yes | Device IMEI |
curl -H "Authorization: Bearer gps_your_key" \
https://platform.gpsafe.io/api/v1/devices/350612345678901/status
200 OK{
"success": true,
"data": {
"deviceId": "350612345678901",
"name": "TOYOTA HILUX",
"plates": "ABC1234",
"status": "Moving",
"engineStatus": "On",
"latitude": 19.432608,
"longitude": -99.133209,
"address": "Av. Reforma 222, CDMX",
"speedKmh": 45,
"heading": 270,
"odometerKm": 128450.3,
"satellites": 12,
"powerVoltage": "13.8",
"backupVoltage": "4.1",
"signalStrength": 28,
"connectionType": "4G",
"lastReportUtc": "2026-03-10T15:28:44Z",
"minutesSinceReport": 2
},
"timestamp": "2026-03-10T15:30:00Z"
}
404 — Device Not Found{
"success": false,
"error": "Device not found or no access",
"timestamp": "2026-03-10T15:30:00Z"
}
Returns all geofences belonging to the account, sorted alphabetically. Each geofence includes its center coordinates and the full list of polygon vertices.
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer {api_key} |
None.
curl -H "Authorization: Bearer gps_your_key" \
https://platform.gpsafe.io/api/v1/geofences
200 OK{
"success": true,
"data": [
{
"id": 42,
"name": "Central Warehouse",
"centerLat": 19.432608,
"centerLng": -99.133209,
"radiusMeters": 250.0,
"vertexCount": 4,
"vertices": [
{ "lat": 19.433, "lng": -99.134 },
{ "lat": 19.433, "lng": -99.132 },
{ "lat": 19.432, "lng": -99.132 },
{ "lat": 19.432, "lng": -99.134 }
]
}
],
"timestamp": "2026-03-10T15:30:00Z"
}
| Field | Type | Description |
|---|---|---|
id | int | Geofence ID |
name | string | Geofence name |
centerLat | double | Center latitude |
centerLng | double | Center longitude |
radiusMeters | double | Approximate radius in meters |
vertexCount | int | Number of polygon vertices |
vertices | array | Ordered list of {lat, lng} polygon points |
Creates a new travel route for a vehicle. The starting point is always the vehicle's current GPS position at the specified startTime. Geofence names must match exactly (case-sensitive) with existing geofences in your account.
{
"vehicle": "CC-05",
"startTime": "11/03/2026 08:00",
"waypoints": [
{ "geofence": "Central Office", "expectedArrival": "11/03/2026 09:30" },
{ "geofence": "North Plant", "expectedArrival": "11/03/2026 11:00" }
]
}
| Field | Type | Description |
|---|---|---|
vehicle | string | Required — Exact vehicle name as registered in the platform |
startTime | string | Required — Start date/time in dd/MM/yyyy HH:mm format (local timezone) |
waypoints | array | Required — At least one destination waypoint |
waypoints[].geofence | string | Exact geofence name (case-sensitive) |
waypoints[].expectedArrival | string | Expected arrival time in dd/MM/yyyy HH:mm format (local timezone) |
200 OK{
"success": true,
"data": {
"travelId": 123,
"vehicle": "CC-05",
"status": "Scheduled",
"timezone": "America/Mexico_City",
"progress": 0,
"totalWaypoints": 3,
"completedWaypoints": 0,
"startTime": { "local": "11/03/2026 08:00", "utc": "11/03/2026 14:00" },
"waypoints": [
{ "order": 1, "geofence": "Current position",
"status": "Pending",
"expectedArrival": { "local": "11/03/2026 08:00", "utc": "11/03/2026 14:00" },
"arrivedAt": null, "estimatedArrival": null,
"delayMinutes": null, "timing": "" },
{ "order": 2, "geofence": "Central Office",
"status": "Pending",
"expectedArrival": { "local": "11/03/2026 09:30", "utc": "11/03/2026 15:30" },
"arrivedAt": null, "estimatedArrival": null,
"delayMinutes": null, "timing": "" }
]
}
}
| Error | Cause |
|---|---|
| Vehicle not found | The vehicle name does not exactly match any registered vehicle |
| Geofence not found | A geofence name does not exactly match any existing geofence |
| Active travel exists | The vehicle already has a scheduled or in-progress travel |
| Invalid date format | Use the dd/MM/yyyy HH:mm format |
Retrieves the full status of a travel, including all waypoints with expected times, actual arrival times, live ETA estimates, delay metrics, and timing labels. Designed for real-time monitoring via polling every few seconds.
| Parameter | Type | Description |
|---|---|---|
id | int | Travel ID (returned when creating a travel or from the active travels list) |
curl -H "Authorization: Bearer gps_your_key" \
https://platform.gpsafe.io/api/v1/travels/123
200 OK — In-progress travel{
"success": true,
"data": {
"travelId": 123, "vehicle": "CC-05",
"status": "In progress", "progress": 33.3,
"totalWaypoints": 3, "completedWaypoints": 1,
"timezone": "America/Mexico_City",
"startTime": { "local": "11/03/2026 08:00", "utc": "11/03/2026 14:00" },
"waypoints": [
{ "order": 1, "geofence": "Current position",
"status": "Completed",
"expectedArrival": { "local": "11/03/2026 08:00", "utc": "11/03/2026 14:00" },
"arrivedAt": { "local": "11/03/2026 08:01", "utc": "11/03/2026 14:01" },
"estimatedArrival": null,
"delayMinutes": null, "timing": "On time" },
{ "order": 2, "geofence": "Central Office",
"status": "Pending",
"expectedArrival": { "local": "11/03/2026 09:30", "utc": "11/03/2026 15:30" },
"arrivedAt": null,
"estimatedArrival": { "local": "11/03/2026 09:45", "utc": "11/03/2026 15:45" },
"delayMinutes": 15, "timing": "+15 min late (est.)" }
]
}
}
| Field | Type | Description |
|---|---|---|
order | int | Sequential waypoint number |
geofence | string | Geofence name ("Current position" for the starting point) |
status | string | Completed · Pending · Cancelled |
expectedArrival | object | {local, utc} — Scheduled arrival time |
arrivedAt | object|null | {local, utc} — Actual arrival time (null if not yet arrived) |
estimatedArrival | object|null | {local, utc} — Live ETA from the server (updated every ~30s) |
delayMinutes | int|null | Delay in minutes (positive = late, negative = ahead of schedule) |
timing | string | Human-readable label: "On time", "+15 min late", "10 min early", etc. |
Cancels an active or scheduled travel. Only works when the travel status is Scheduled (0) or In progress (1). Completed or already cancelled travels cannot be cancelled.
curl -X DELETE -H "Authorization: Bearer gps_your_key" \
https://platform.gpsafe.io/api/v1/travels/123
200 OK{
"success": true,
"data": {
"travelId": 123,
"status": "Cancelled",
"message": "Travel cancelled successfully."
}
}
Returns a summary of all active travels (scheduled or in progress) for the account. Each entry includes progress percentage, next waypoint information, and delay metrics.
curl -H "Authorization: Bearer gps_your_key" \
https://platform.gpsafe.io/api/v1/travels
200 OK{
"success": true,
"data": [
{
"travelId": 123, "vehicle": "CC-05",
"status": "In progress", "progress": 33.3,
"totalWaypoints": 3, "completedWaypoints": 1,
"nextWaypoint": "Central Office",
"delayMinutes": 5, "timing": "+5 min late",
"startTime": { "local": "11/03/2026 08:00", "utc": "11/03/2026 14:00" }
},
{
"travelId": 124, "vehicle": "CC-07",
"status": "Scheduled", "progress": 0,
"totalWaypoints": 2, "completedWaypoints": 0,
"nextWaypoint": "Current position",
"delayMinutes": null, "timing": "",
"startTime": { "local": "11/03/2026 14:00", "utc": "11/03/2026 20:00" }
}
]
}
| Field | Type | Description |
|---|---|---|
travelId | int | Unique travel identifier |
vehicle | string | Vehicle name |
status | string | Scheduled · In progress |
progress | double | Completion percentage (0–100) |
totalWaypoints | int | Total waypoints including the starting position |
completedWaypoints | int | Number of completed waypoints |
nextWaypoint | string|null | Name of the next pending waypoint |
delayMinutes | int|null | Delay for the next waypoint (null if unavailable) |
timing | string | Timing label for the next waypoint |
startTime | object | {local, utc} — Travel start time |