Login

Developers

Your fleet data,
in your own systems.

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.

Read the help centre ↗
REST + JSONAPI key auth40+ endpoints

Quick start

Make your first call in three steps.

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.

2 · Call the API

Send HTTPS requests to the base URL with your key and secret in the request headers. Responses are JSON.

3 · Use the data

Feed vehicles, locations, alerts and trips into your dashboards, ERP or transport management system.

Base URL
https://safartrack-backend.safartrak.com/api/v1/external

API 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

Every request carries your API key and secret.

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.

Headers
X-API-Key: <your API key ID>
X-API-Password: <your API secret>
Example: list vehicles that are moving
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"
Example: yesterday's route for one vehicle (JavaScript)
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

Endpoints by resource.

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.

Vehicles & live location

Current fleet state, live positions and the full route a vehicle drove.

Vehicles & live location endpoints
MethodPathWhat it returns
GET/vehiclesList vehicles with their current status. Filter with search, status, vehicleType, vehicleCategory and fleetGroup; paginate with page and limit.
GET/vehicles/summaryFleet 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-historyRoute history for a vehicle. Use period (default today) or a from and to range; add snap to align the path to roads.
GET/locationsLive location feed for the vehicles in your account.

Temperature (cold chain)

Readings from compatible temperature sensors.

Temperature (cold chain) endpoints
MethodPathWhat it returns
GET/temperatureCurrent temperature status across sensor-equipped vehicles.
GET/temperature/{uniqueId}/historyTemperature history for one vehicle over a date range.

Alerts & driver events

Speeding, idling, geofence and other configured events.

Alerts & driver events endpoints
MethodPathWhat it returns
GET/alertsList alerts, newest first, with filters and pagination.
GET/alerts/countNumber of alerts matching your filters.
GET/alerts/summaryAlert totals grouped by type.
GET/alerts/typesThe alert types available for your account.
GET/alerts/exportDownload matching alerts as CSV.

Analytics & reports

Distance, performance and fleet-level reporting.

Analytics & reports endpoints
MethodPathWhat it returns
GET/analytics/summaryFleet analytics summary for the selected range.
GET/analytics/distance-seriesDistance travelled over time, for charts and BI tools.
GET/analytics/performanceVehicle performance metrics for the selected range.
GET/analytics/exportExport analytics as JSON.

Utilisation & vendors

Kilometre and hour utilisation by vehicle, vendor and city.

Utilisation & vendors endpoints
MethodPathWhat it returns
GET/utilisation/summaryUtilisation overview for a date range.
GET/utilisation/vehiclesPer-vehicle utilisation, filterable by city, vendor, vehicle type and utilisation band.
GET/utilisation/vendorsUtilisation grouped by vendor; /utilisation/vendors/{vendorId} for one vendor.
GET/utilisation/matrixUtilisation matrix for planning and comparison.
GET/utilisation/alertsUnder- and over-utilisation flags.
GET/utilisation/reuseReuse opportunities for under-used vehicles.

Trip schedules

Create, update and track planned trips and checkpoints.

Trip schedules endpoints
MethodPathWhat it returns
GET/trip-schedulesList trip schedules; /trip-schedules/summary for totals.
POST/trip-schedulesCreate 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-csvDownload the CSV template for bulk upload.
POST/trip-schedules/bulk-uploadUpload many trip schedules from a CSV file (multipart form).

Reference data

Lists you can use to build filters and forms.

Reference data endpoints
MethodPathWhat it returns
GET/vehicle-typesVehicle types in your account.
GET/vehicle-categoriesVehicle categories.
GET/fleet-groupsFleet groups.
GET/vendorsVendors; /vendors/cities for the cities they operate in.
GET/associated-clientsAssociated client accounts you can access.

Responses & errors

Predictable JSON, clear status codes.

Error response
{
  "success": false,
  "message": "Invalid API key or API secret."
}
HTTP status codes
StatusMeaning
200Success. The body contains success: true and the requested data.
401The API key or secret is missing or invalid.
403The credentials are valid but the account is inactive or cannot access this data.
404The vehicle, trip or other record was not found in your account.
5xxA temporary server problem. Retry with backoff, and contact 24/7 support if it continues.

Integrations

Connect devices in, and data out.

Devices send data in; the API, exports and Rahi carry it out to your teams and systems.

All kinds of devices

SafarTrak supports all kinds of GPS trackers, telematics devices and sensors, alongside our own ST100 and ST200.

Compatible devices ↗

ERP, TMS & BI tools

Use the API, CSV exports and JSON analytics exports to feed transport management, ERP and business-intelligence systems.

Plan your connections ↗

Rahi on WhatsApp & in the portal

Rahi, SafarTrak's AI assistant, answers questions about your own fleet inside the portal and on WhatsApp, without any code.

Meet Rahi ↗
Become a technology partner ↗

See SafarTrak at work

Show us the fleet problemyou want to solve.

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