Fleet-Track REST API Reference

The Fleet-Track API lets you manage your fleet, stream live GPS positions, push telemetry from your own hardware, read OBD-II / CAN diagnostics and automate threshold alerts — all over plain HTTPS + JSON.

Environment Base URL
Production https://api.fleet-track.org
Local development http://127.0.0.1:8092

Every path below is relative to that base URL. The same endpoints also answer on the main site under /api/ (for example https://fleet-track.org/api/gps/), which is handy for browser testing.


1. Authentication

Fleet-Track uses token authentication. Send your personal API token with every request:

Authorization: Token <YOUR_API_TOKEN>

Your token is on the Profile page of the dashboard after email verification, and never expires unless you regenerate it.

Requests without a valid token receive 401 Unauthorized, except the tracker ingestion webhook (section 7), which is authenticated with a shared secret that only the Traccar gateway knows.


2. Vehicles — /vehicles/

A vehicle links a tracker's hardware ID (IMEI / device.uniqueId) to your account. Save the IMEI of a tracker and its positions start appearing on your dashboard — no support ticket needed.

List your vehicles

GET /vehicles/
Authorization: Token <YOUR_TOKEN>
[
  {
    "id": 14,
    "fleet_no": "TRUCK-01",
    "vehicle_name": "Kenworth T610",
    "imei": "860123456789012",
    "ip_address": null,
    "coordinate_format": "decimal",
    "time_zone": "Australia/Brisbane"
  }
]

You only ever see your own vehicles.

Register a vehicle / attach a tracker

POST /vehicles/
Content-Type: application/json
Authorization: Token <YOUR_TOKEN>

{
  "fleet_no": "VAN-04",
  "vehicle_name": "Toyota HiAce Delivery",
  "imei": "864987654321098",
  "coordinate_format": "decimal",
  "time_zone": "Australia/Sydney"
}

201 Created returns the saved object. imei is unique — one tracker, one vehicle.

Update / rename

PATCH /vehicles/15/
Content-Type: application/json
Authorization: Token <YOUR_TOKEN>

{ "vehicle_name": "Toyota HiAce North Route" }

3. Querying positions — GET /gps/

Returns the latest position per account (one row), or the latest position of one vehicle when you pass the vehicle name in the HTTP_USER header:

GET /gps/
Authorization: Token <YOUR_TOKEN>
HTTP_USER: Kenworth T610
[
  {
    "id": 89412,
    "vehicle_name": "Kenworth T610",
    "vehicle": 14,
    "utc": "2026-11-24T08:30:15Z",
    "latitude": "-27.469800000",
    "longitude": "153.025100000",
    "altitude": 28.5,
    "speed": "62.50",
    "course": 182.0,
    "valid": true,
    "protocol": "teltonika",
    "vehicle_move_start": 1,
    "vehicle_move_stop": 0,
    "alert": 0,
    "obd_speed": 63,
    "obd_rpm": 2450,
    "obd_coolant_temp": "88.00",
    "obd_fuel_level": "72.00",
    "obd_engine_load": "45.00",
    "obd_odometer_km": "125430.20",
    "trouble_codes": "P0420",
    "telemetry": {
      "battery": 13.8,
      "ignition": true,
      "motion": true,
      "j1939_axle_weight": 8500
    }
  }
]

Notes:

  • speed is km/h and is a decimal ("62.50"), not an integer. Convert to mph with speed * 0.621371. Dashboard users who set their profile to mph see mph automatically.
  • protocol is the decoded tracker protocol (teltonika, gt06, ruptela, meitrack, osmand, ...).
  • telemetry is the lossless payload: every raw attribute the protocol decoder produced, including J1939 PGNs, battery voltage, axle weights and anything a manufacturer adds. Nothing is discarded.
  • Premium telemetry: telemetry, trouble_codes and the obd_* fields are only returned for accounts with premium telematics access. Free accounts get the GPS fields only.

4. Pushing your own telemetry — POST /gps/

Custom hardware (Raspberry Pi, Arduino, a local CAN gateway, a phone app) can post positions directly, no Traccar needed.

POST /gps/
Content-Type: application/json
Authorization: Token <YOUR_TOKEN>

{
  "vehicle_name": "Kenworth T610",
  "utc": "2026-11-24 08:30:00",
  "latitude": -27.469800,
  "longitude": 153.025100,
  "speed": 62.5,
  "vehicle_move_start": 1,
  "vehicle_move_stop": 0,
  "obd_speed": 63,
  "obd_rpm": 2450,
  "obd_coolant_temp": "88.00",
  "obd_fuel_level": "72.00",
  "obd_engine_load": "45.00",
  "obd_odometer_km": "125430.00",
  "trouble_codes": "P0420"
}

vehicle_name is matched against your fleet numbers and vehicle names, so the record lands on the right vehicle. Send an array of objects to upload a buffer of points collected while offline:

[
  { "vehicle_name": "Kenworth T610", "utc": "2026-11-24 08:28:00", "latitude": -27.471, "longitude": 153.024, "speed": 60.0 },
  { "vehicle_name": "Kenworth T610", "utc": "2026-11-24 08:29:00", "latitude": -27.4705, "longitude": 153.0245, "speed": 61.2 }
]

200 OK returns the saved record(s) with their ids.

If your device reports NMEA coordinates (DDMM.MMMM), either set the vehicle's coordinate_format to nmea or send the raw value — anything with abs(latitude) > 90 is converted automatically.


5. Hardware trackers (Traccar gateway)

Supported hardware connects to the Traccar protocol gateway, which decodes the device and forwards normalised positions to Fleet-Track. Configure the tracker to report to your server on the protocol port:

Tracker family Protocol port Example models
Teltonika (CAN / J1939) 10027 (TCP/UDP) FMB920, FMC130, FMB130
Concox / Jimi IoT (GT06) 10023 (TCP/UDP) GT06N, VL03
Queclink 10015 (TCP/UDP) GL300, GV300
Ruptela (heavy vehicle) 10003 (TCP) HCV5, FM-Eco4
Meitrack 10020 (TCP/UDP) T366, P99G
Coban 10005 (TCP/UDP) TK303
CalAmp 10008 (TCP) LMU-3000
GPS103 / TK103 10001 (TCP/UDP) generic clones
OsmAnd / mobile apps / HTTP 10055 (TCP) any phone running OsmAnd

Steps:

  1. Insert the SIM, set the APN and set the server address to the Fleet-Track server IP (192.168.20.207 on the LAN, or the public IP) with the port for your device family.
  2. Note the device IMEI — it is printed on the label.
  3. Add it to a vehicle: PATCH /vehicles/<id>/ {"imei": "<IMEI>"} (or type it on the vehicle setup page).
  4. Movement shows up on the dashboard within one reporting interval.

Unregistered IMEIs are accepted by the gateway and then discarded by Fleet-Track, so a tracker can be fitted before the account is configured.


6. Thresholds and alerts

Premium accounts define thresholds (/threshold_setup/ in the dashboard, or the admin) on any numeric field: speed, obd_rpm, obd_coolant_temp, obd_fuel_level, obd_engine_load, or any key that appears in telemetry (for example j1939_axle_weight).

When an incoming position breaches a threshold:

  1. an alert record is created (visible on Vehicle Alerts),
  2. the position is flagged ("alert": 1 in the API),
  3. the dashboard shows the count on the home screen.

Both max_value and min_value are supported, and a threshold can apply to the whole fleet or to one vehicle.


7. Ingestion webhook (internal)

POST /api/v1/traccar/webhook/ receives the JSON that the Traccar gateway forwards. It is not part of the public API surface: it requires the header X-Traccar-Secret matching TRACCAR_WEBHOOK_SECRET from the server .env, and is exempt from the HTTPS redirect so the Docker-internal HTTP call works.

You should not call it yourself — use POST /gps/ (section 4) instead. It is documented here because it is the contract between the gateway and the app: the payload is either one Traccar object {"position": {...}, "device": {"uniqueId": "..."}} or a list of them, speeds are knots (converted to km/h on ingest), odometer values are metres (converted to km) and every attribute is retained in telemetry.


8. Code examples

Python

import requests

BASE_URL = "https://api.fleet-track.org"
TOKEN = "YOUR_API_TOKEN"
headers = {"Authorization": f"Token {TOKEN}", "Content-Type": "application/json"}

# Live position for the whole fleet
for point in requests.get(f"{BASE_URL}/gps/", headers=headers).json():
    print(point["vehicle_name"], point["speed"], "km/h", point["latitude"], point["longitude"])

# Register a tracker
print(requests.post(f"{BASE_URL}/vehicles/", headers=headers, json={
    "fleet_no": "VAN-01", "vehicle_name": "Delivery Van 1",
    "imei": "860123456789012"}).status_code)

# Push one telemetry sample from custom hardware
print(requests.post(f"{BASE_URL}/gps/", headers=headers, json={
    "vehicle_name": "Delivery Van 1", "utc": "2026-11-24 09:00:00",
    "latitude": -27.4698, "longitude": 153.0251, "speed": 55.4,
    "obd_rpm": 2100, "obd_coolant_temp": "85.0"}).status_code)

JavaScript (browser / Node 18+)

const BASE_URL = 'https://api.fleet-track.org';
const TOKEN = 'YOUR_API_TOKEN';

const res = await fetch(`${BASE_URL}/gps/`, {
  headers: { 'Authorization': `Token ${TOKEN}`, 'Content-Type': 'application/json' }
});
const live = await res.json();
console.log(live);

cURL

# Latest position
curl -s "https://api.fleet-track.org/gps/" \
     -H "Authorization: Token YOUR_API_TOKEN"

# Latest position of one vehicle
curl -s "https://api.fleet-track.org/gps/" \
     -H "Authorization: Token YOUR_API_TOKEN" \
     -H "HTTP_USER: Kenworth T610"

# Attach an IMEI to a vehicle
curl -s -X PATCH "https://api.fleet-track.org/vehicles/15/" \
     -H "Authorization: Token YOUR_API_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"imei": "860123456789012"}'

9. HTTP response codes

Code Meaning
200 OK Request succeeded (position pushed, list returned).
201 Created Vehicle or telemetry record created.
400 Bad Request Malformed JSON, or a value outside the allowed range (e.g. speed > 9999.99 km/h).
401 Unauthorized Missing/invalid token, or missing/invalid webhook secret.
403 Forbidden Authenticated but not allowed (for example free-tier limits).
404 Not Found No such vehicle or record.

10. Limits worth knowing

  • speed is stored in km/h with 2 decimals, maximum 9999.99.
  • latitude / longitude keep 9 decimals (about 1 mm).
  • Trouble codes are comma separated and capped at 255 characters.
  • A position is de-duplicated on (vehicle, timestamp, coordinates), so a device that retries a failed upload does not create a second row or a second alert.
  • The gateway retries a failed forward three times before dropping the position.