1 · Create credentials
In the SafarTrak portal, open API Credentials and create an API key. You receive a key ID and a secret; the secret is shown once, so store it safely.
Developers
The SafarTrak API gives your ERP, TMS, BI and in-house tools secure access to vehicles, live locations, route history, alerts, analytics, utilisation and trip schedules.
Quick start
In the SafarTrak portal, open API Credentials and create an API key. You receive a key ID and a secret; the secret is shown once, so store it safely.
Send HTTPS requests to the base URL with your key and secret in the request headers. Responses are JSON.
Feed vehicles, locations, alerts and trips into your dashboards, ERP or transport management system.
https://safartrack-backend.safartrak.com/api/v1/externalAPI access is enabled per customer account. If you cannot see API Credentials in your portal, ask your account team or 24/7 support to enable it.
Authentication
Send the key ID and secret as headers. HTTP Basic authentication, with the key ID as the username and the secret as the password, is also accepted. Keys are scoped to your company's fleet data and can be revoked from the portal at any time.
X-API-Key: <your API key ID>
X-API-Password: <your API secret>curl "https://safartrack-backend.safartrak.com/api/v1/external/vehicles?status=moving&page=1&limit=50" \
-H "X-API-Key: $SAFARTRAK_API_KEY" \
-H "X-API-Password: $SAFARTRAK_API_SECRET"const res = await fetch(
"https://safartrack-backend.safartrak.com/api/v1/external/vehicles/VEHICLE_ID/route-history?period=yesterday",
{ headers: {
"X-API-Key": process.env.SAFARTRAK_API_KEY,
"X-API-Password": process.env.SAFARTRAK_API_SECRET,
} }
);
const { success, data } = await res.json();Keep secrets on your server. Never put them in a mobile app, browser code or a public repository.
API reference
All paths are relative to the base URL. Every successful response includes success: true; list endpoints accept page and limit, and date-based endpoints accept from and to.
Current fleet state, live positions and the full route a vehicle drove.
| Method | Path | What it returns |
|---|---|---|
| GET | /vehicles | List vehicles with their current status. Filter with search, status, vehicleType, vehicleCategory and fleetGroup; paginate with page and limit. |
| GET | /vehicles/summary | Fleet status counts (moving, idle, stopped, offline) using the same filters as /vehicles. |
| GET | /vehicles/{uniqueId} | One vehicle's current details and latest reading. |
| GET | /vehicles/{uniqueId}/route-history | Route history for a vehicle. Use period (default today) or a from and to range; add snap to align the path to roads. |
| GET | /locations | Live location feed for the vehicles in your account. |
Readings from compatible temperature sensors.
| Method | Path | What it returns |
|---|---|---|
| GET | /temperature | Current temperature status across sensor-equipped vehicles. |
| GET | /temperature/{uniqueId}/history | Temperature history for one vehicle over a date range. |
Speeding, idling, geofence and other configured events.
| Method | Path | What it returns |
|---|---|---|
| GET | /alerts | List alerts, newest first, with filters and pagination. |
| GET | /alerts/count | Number of alerts matching your filters. |
| GET | /alerts/summary | Alert totals grouped by type. |
| GET | /alerts/types | The alert types available for your account. |
| GET | /alerts/export | Download matching alerts as CSV. |
Distance, performance and fleet-level reporting.
| Method | Path | What it returns |
|---|---|---|
| GET | /analytics/summary | Fleet analytics summary for the selected range. |
| GET | /analytics/distance-series | Distance travelled over time, for charts and BI tools. |
| GET | /analytics/performance | Vehicle performance metrics for the selected range. |
| GET | /analytics/export | Export analytics as JSON. |
Kilometre and hour utilisation by vehicle, vendor and city.
| Method | Path | What it returns |
|---|---|---|
| GET | /utilisation/summary | Utilisation overview for a date range. |
| GET | /utilisation/vehicles | Per-vehicle utilisation, filterable by city, vendor, vehicle type and utilisation band. |
| GET | /utilisation/vendors | Utilisation grouped by vendor; /utilisation/vendors/{vendorId} for one vendor. |
| GET | /utilisation/matrix | Utilisation matrix for planning and comparison. |
| GET | /utilisation/alerts | Under- and over-utilisation flags. |
| GET | /utilisation/reuse | Reuse opportunities for under-used vehicles. |
Create, update and track planned trips and checkpoints.
| Method | Path | What it returns |
|---|---|---|
| GET | /trip-schedules | List trip schedules; /trip-schedules/summary for totals. |
| POST | /trip-schedules | Create a trip schedule with its checkpoints. |
| GET | /trip-schedules/{tripId} | One trip schedule and its progress. |
| PATCH | /trip-schedules/{tripId} | Update a trip schedule. |
| DELETE | /trip-schedules/{tripId} | Remove a trip schedule. |
| GET | /trip-schedules/template-csv | Download the CSV template for bulk upload. |
| POST | /trip-schedules/bulk-upload | Upload many trip schedules from a CSV file (multipart form). |
Lists you can use to build filters and forms.
| Method | Path | What it returns |
|---|---|---|
| GET | /vehicle-types | Vehicle types in your account. |
| GET | /vehicle-categories | Vehicle categories. |
| GET | /fleet-groups | Fleet groups. |
| GET | /vendors | Vendors; /vendors/cities for the cities they operate in. |
| GET | /associated-clients | Associated client accounts you can access. |
Responses & errors
{
"success": false,
"message": "Invalid API key or API secret."
}| Status | Meaning |
|---|---|
| 200 | Success. The body contains success: true and the requested data. |
| 401 | The API key or secret is missing or invalid. |
| 403 | The credentials are valid but the account is inactive or cannot access this data. |
| 404 | The vehicle, trip or other record was not found in your account. |
| 5xx | A temporary server problem. Retry with backoff, and contact 24/7 support if it continues. |
Integrations
SafarTrak supports all kinds of GPS trackers, telematics devices and sensors, alongside our own ST100 and ST200.
Compatible devices ↗Use the API, CSV exports and JSON analytics exports to feed transport management, ERP and business-intelligence systems.
Plan your connections ↗Rahi, SafarTrak's AI assistant, answers questions about your own fleet inside the portal and on WhatsApp, without any code.
Meet Rahi ↗See SafarTrak at work
Tell us which systems you want to connect and the fleet data they need. We will enable API access for your account and help your developers get their first call working.
Talk to the SafarTrak team