Vehicles, drivers and trackers
hayaterp.com ↗Set up Hayat Fleet — vehicles with registration, type, fuel, tank, odometer, ownership, speed limit and tracker IMEI; drivers with licence and HR link; registration, insurance, fitness, route permit, token tax and licence documents with expiry; GPS devices (one tracker per vehicle, or a gateway that forwards for all) and their secret; pointing a tracker or a forwarding service at the Hayat ingest address with the generic or Teltonika JSON; and phone tracking with a driver token.
This page sets up the fleet: the vehicles, the drivers, their documents, and the GPS devices that report positions — or the driver's phone doing the same. Everything here needs fleet.manage, except assigning a driver to a vehicle (fleet.dispatch).
Vehicles
Vehicles → + Vehicle:
| Field | Fill |
|---|---|
| Reg no., Code | e.g. LES-21-4410, T-07; the registration must be unique |
| Make, Model, Year, Colour | |
| Type | Car, Van, Pickup, Truck, Bus, Motorcycle, Trailer, Tanker or Other |
| Fuel type, Tank (litres) | Petrol, Diesel, CNG, LPG, Electric or Hybrid; the tank size is used to catch over-fills |
| Odometer (km) | The reading today; it can only go up |
| Ownership | Owned, Leased (with leased from and lease ends — you are reminded) or Rented |
| Chassis no., Engine no., Group | Group is your own grouping (e.g. Karachi depot, Buses) for filters |
| Driver | The regular driver |
| Speed limit, Expected km/L | This vehicle's own over-speed limit and fuel economy (else the settings) |
| Tracker IMEI | 8–20 digits, if a tracker is fitted |
| Status | Active, In workshop, Inactive or Sold (sold vehicles are hidden from the list) |
| Purchase date, Purchase cost, Branch |
The vehicle page has tabs Overview (its live position, open alerts and the last 30 days' costs by category), Documents, Fuel, Costs, Service, Tyres and Trips. Its current odometer is the higher of the reading you typed and the GPS odometer.
Assign a driver from the vehicle page (fleet.dispatch). A driver drives one vehicle at a time; assigning them elsewhere frees the old one.
Drivers
Drivers → + Driver: name (or pick the HR employee and the name is taken from it), code (made for you if empty), phone, national ID, licence no., licence category and licence expiry, status (Active, Suspended or Inactive) and notes.
Phone, national ID and licence numbers are stored encrypted; search finds them by the exact number only. Making a driver suspended or inactive removes their phone-tracking token and frees their vehicle.
Documents
On a vehicle or a driver, + Document:
| Kind | Typical |
|---|---|
| Registration, Insurance, Fitness, Route permit, Token tax | Vehicle papers |
| Licence | Driver's licence |
| Other | Anything else |
Fill the number, issuer, issued and expires on dates and the amount paid, then upload the scan (PDF, JPG, PNG or WebP, up to 10 MB). Files are private and open only for signed-in staff. Fleet managers are reminded before anything expires (Document expiry reminder, 30 days by default), and the Document & licence expiry report lists them.
GPS devices: connect a tracker
A GPS device in Hayat is a key that lets something post positions. There are two kinds:
| Kind | Use when | Sends |
|---|---|---|
| Tracker | The device (or a service on its behalf) posts for one vehicle | Only its own IMEI |
| Gateway | One forwarder posts for every vehicle of the company — e.g. your tracking server | Any IMEI; each point is matched to the vehicle with that tracker IMEI |
- Put the tracker's IMEI on the vehicle (or let step 2 do it).
- GPS devices → + Device: a name, the kind, the protocol (Generic or Teltonika), and for a tracker the IMEI and the vehicle it is fitted in. Save.
- The secret is shown once. Copy secret and keep it safe; Copy curl copies a ready test command.
- Set up the device or forwarder to send to the address below with the secret in the header.
- Run the test command, or wait for the first report, and open the Live map — the vehicle shows online.
The device list shows the last time each one reported and the last four characters of its secret. Rotate secret makes a new one; the old one stops working at once, so update the device straight away.
What to send
| Address | POST https://backend.hayaterp.com/api/fleet/gps/ingest |
| Header | X-Fleet-Device: <secret> (or Authorization: Device <secret>) |
| Body | JSON, in either shape below — up to 1,000 points per request |
| Answer | {"accepted": 1, "rejected": 0, "unknownImei": 0} |
Generic JSON — speed in km/h, odometer in km, time in UTC (now if missing):
json
{ "points": [ { "imei": "356307042441013", "lat": 24.8607, "lng": 67.0011,
"speed": 42.5, "heading": 180, "ignition": true,
"odometer": 84210.4, "at": "2026-11-08T09:15:00Z" } ] }
Teltonika codec 8 / 8E, decoded — the records as a decoder or forwarding service passes them on:
json
{ "imei": "356307042441013",
"records": [ { "timestamp": 1762593300000, "priority": 0,
"gps": { "latitude": 24.8607, "longitude": 67.0011, "altitude": 12,
"angle": 180, "satellites": 9, "speed": 42 },
"io": { "239": 1, "240": 1, "16": 84210400 } } ] }
timestamp is in milliseconds (seconds also work). Hayat reads IO 239 as ignition, 240 (movement) when there is no ignition, 16 as the total odometer in metres and 24 as speed when gps.speed is missing.
Points dated more than 5 minutes in the future, older than Keep positions, or at 0,0 are rejected. Points for an IMEI that matches no vehicle are counted as unknownImei. Each device may send up to 600 requests a minute. While Hayat Fleet is switched off for the business, the address answers 401.
Phone tracking
A driver's phone can report positions instead of (or as well as) a tracker. It signs in with a driver token, not a user login.
- Drivers, open the driver, Issue token. The token and a QR code are shown once. The QR holds the server address and the token, for the phone app to scan.
- In the phone app, scan the QR (or enter the token).
- While the driver works, the app sends positions about every 15 seconds.
Issue a new token replaces the old one; Revoke stops it.
For the developer of the phone app, the driver API is:
| Call | What |
|---|---|
GET /api/fleet/app/me |
The driver, their vehicle, the business and the tracking interval in seconds |
POST /api/fleet/app/location |
{"points": [{"lat", "lng", "speed", "heading", "at", "accuracy"}], "vehicleId"} — up to 500 points |
GET /api/fleet/app/trips |
The driver's open trips and those completed in the last day |
POST /api/fleet/app/trips/{id}/status |
Started, Arrived, Delivered or Completed |
POST /api/fleet/app/trips/{id}/pod?kind=photo (or signature) |
Proof of delivery image |
on https://backend.hayaterp.com, with the header X-Fleet-Driver: <token>. Points less accurate than 200 m are dropped. The position goes to the vehicle given (if the driver is assigned to it or on a trip with it), else the vehicle of their current trip, else their assigned vehicle; with none, the call is refused. On the live map these positions show the source Phone.