NoMilesLostDevelopers

API v1

Connect your dispatch system to NoMilesLost

Send trips and uncovered bookings as they happen. NoMilesLost spots drivers about to return empty, offers them suitable bookings from other companies licensed by the same council, and tells your system when a job is confirmed.

1Your system sends trip.started and booking.unassigned
2NoMilesLost finds a returning driver for a booking
3Your dispatcher or driver accepts
4A signed webhook tells both systems the job is confirmed

Quick start

  1. Sign in to the Network Partner console and open Company.
  2. Create a test key and build your connection against it. Nothing real changes.
  3. When everything returns ok, create a live key and switch over.
Check your key
curl https://nomileslost.co.uk/api/v1/ping \
  -H "Authorization: Bearer nml_test_..."
Response
{"ok": true, "operator": "Your Company", "provider": "GENERIC", "mode": "test", "apiVersion": "v1"}

API keys

Every request carries Authorization: Bearer <key>. Keys start with nml_live_ or nml_test_. A key is shown once when it is created; NoMilesLost stores only a scrambled copy (a hash). You can replace or revoke a key at any time on the Company page; a revoked key stops working immediately.

Keep keys on your server. Never put them in a mobile app, a web page or a shared document.

Test mode

A test key behaves exactly like a live key: the same addresses, checks and answers. The difference is that nothing is saved and no driver or dispatcher is contacted. Event responses include "mode": "test", and GET /assignments returns one example assignment so you can build against the real format.

Sending events

POST https://nomileslost.co.uk/api/v1/events with one event, or up to 100 as {"events": [...]}. Status 200 means all were accepted, 207 some, 400 none; each event has its own result.

EventSend it when
trip.startedA driver picks up a passenger. NoMilesLost works out whether the drop-off will leave the driver far from base.
trip.updatedThe expected drop-off time changes.
trip.completed / trip.cancelledThe trip ends or is cancelled.
booking.unassignedYou have a booking but no driver for it.
booking.assigned / booking.cancelledYou covered the booking yourself, or it was cancelled.
driver.available / driver.unavailableA driver is free and waiting (with location), or no longer free. Lets nearby bookings be offered to your company to cut passenger wait times.
driver.locationOptional GPS for drivers on NoMilesLost journeys (every 30–60 seconds).
A driver picks up a long trip
curl https://nomileslost.co.uk/api/v1/events \
  -H "Authorization: Bearer nml_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "trip.started",
    "tripId": "OX-9001",
    "driver": { "id": "drv-17", "callSign": "Car 17", "vehicle": "saloon",
                "name": "J. Smith", "badge": "PH-1234", "reg": "AB12 CDE",
                "description": "Toyota Corolla Hybrid, silver" },
    "pickup":  { "lat": 51.752, "lon": -1.2577, "label": "Oxford, High Street" },
    "dropoff": { "lat": 51.470, "lon": -0.4543, "label": "Heathrow Terminal 5" },
    "etaDropoff": "2026-11-20T10:05:00+00:00"
  }'
A booking you have no driver for
{
  "type": "booking.unassigned",
  "bookingId": "BK-2231",
  "ref": "2231",
  "pickup":  { "lat": 51.4588, "lon": -0.9719, "label": "Reading station" },
  "dropoff": { "lat": 51.752, "lon": -1.2577, "label": "Oxford city centre" },
  "pickupAt": "2026-11-20T10:40:00+00:00",
  "vehicle": "saloon",
  "pax": 2,
  "fareGbp": 68
}

Driver name, badge, reg and description are optional. They are shown only to the driver's own company and to a company whose booking the driver is covering, so passengers know which car to expect.

Vehicle types: saloon, estate, exec, mpv (6 seats), eight (8 seats), wav (wheelchair accessible). Times are ISO 8601 with a time zone.

Assignments

When NoMilesLost pairs a returning driver with a booking, it creates an assignment. Both companies must accept before it is confirmed. If nobody answers in time, it is withdrawn and the next best option is offered.

List recent assignments (if you poll instead of using webhooks)
GET https://nomileslost.co.uk/api/v1/assignments?status=PROPOSED,CONFIRMED
Answer an assignment
POST https://nomileslost.co.uk/api/v1/assignments/<id>
{"answer": "accept", "onBehalfOf": "dispatcher"}

Answers: accept, decline, withdraw, or cancel for a confirmed job.

Job progress (the covering company, on a confirmed job): on_way, arrived, picked_up, dropped_off. After picked_up we keep an expected drop-off time, updated by driver.location events for that driver. The driver's next job is looked for shortly before it, and dropped_off frees the driver straight away. We keep the latest location only, never a trail.

Webhooks

Add a webhook address on the Company page. NoMilesLost then posts assignment.offered the moment an offer is made (both tiers, so offers appear in your dispatch system automatically), job.assigned (to the driver's company), booking.covered (to the booking's company), assignment.progress (to both companies, for each job step, with the expected drop-off) and match.cancelled. Each message is signed so you can prove it came from NoMilesLost.

Headers
X-NoMilesLost-Event: job.assigned
X-NoMilesLost-Signature: sha256=<HMAC-SHA256 of the raw body, keyed with your webhook signing secret>
Checking the signature (Node.js)
import { createHmac, timingSafeEqual } from "node:crypto";

function isFromNoMilesLost(rawBody, signatureHeader, secret) {
  const expected = "sha256=" + createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(signatureHeader || "");
  return a.length === b.length && timingSafeEqual(a, b);
}

Errors and limits

StatusMeaning
400The message isn't valid. The response says which field.
401Missing or invalid key, or the company isn't approved yet.
409The assignment has already been answered, withdrawn or expired.
413More than 100 events in one request.
429More than 600 requests a minute on one key. Wait for the time in Retry-After.

Data protection

NoMilesLost is designed to work without passengers' personal data. Never send passenger names, phone numbers or home addresses. Use an area or landmark as the location label. Drivers are identified only by your own driver ID and call sign. Passenger details for a confirmed job are exchanged directly between the two companies.