Your books, by API.
A key you create under More → API keys, shown once, revocable at once. It reads (or writes) exactly one company, the one that made it. Every call it makes is written to that company’s activity log as “API key <name>”.
Authentication
Create a key in the app (owner or admin only): More → API keys → New key. Pick read-only or read-write. The key is shown once; MileBrain stores a hash and cannot show it again. Send it as a bearer token:
curl https://milebrain.com/api/v1/loads \
-H "Authorization: Bearer mbk_0123456789abcdef0123456789abcdef01234567"
A driver, a mechanic (outside shop), a customer-portal login and a demo sandbox can never create a key. A revoked key is refused on its very next call with 401 {"code":"REVOKED"}.
Limits
60 calls a minute and 1,000 an hour per key; past that you get 429 with a Retry-After header. Lists return at most 200 items a page — use limit and offset. Records are at most 300 KB.
Resources
| Path | Methods | What it is |
|---|---|---|
/api/v1/me | GET | The company this key belongs to, the key’s name and scope. |
/api/v1/loads, /api/v1/loads/:id | GET, PUT, DELETE | Loads. Filters: from, to (YYYY-MM-DD, on the delivery date), status. |
/api/v1/customers, /:id | GET, PUT, DELETE | Customers (brokers and shippers). |
/api/v1/trucks, /:id | GET, PUT, DELETE | Trucks. Creating one counts against the plan exactly as in the app (402 PLAN_LIMIT). |
/api/v1/fuel, /:id | GET, PUT, DELETE | Fuel stops. from/to on the stop date. |
/api/v1/repairs, /:id | GET, PUT, DELETE | Repairs and services (the app’s maintenance records). |
/api/v1/invoices, /:id | GET | Invoiced loads with the invoice total, dates and paid state. Read-only: an invoice is made in the app. |
/api/v1/settlements, /:id | GET | Driver settlements as paid. Read-only: the settlement engine computes them. |
/api/v1/claims, /:id | GET | Damage and shortage claims. |
PUT and DELETE need a read-write key; a read-only key gets 403 {"code":"READ_ONLY"}. Invoices, settlements and claims are read-only for every key — their numbers come out of the app’s own engines and are not accepted from outside.
Examples
List this month’s delivered loads
curl "https://milebrain.com/api/v1/loads?from=2026-09-01&to=2026-09-30&status=Delivered" \
-H "Authorization: Bearer $MB_KEY"
{"ok":true,"total":14,"limit":200,"offset":0,"items":[{"id":"l-7f3a","customerName":"Acme Freight Brokers",
"origin":"Detroit, MI","destination":"Chicago, IL","pickupDate":"2026-09-03","deliveryDate":"2026-09-04",
"rate":"1850.00","miles":"283","status":"Delivered", ...}]}
Create or replace a load (read-write key)
PUT is an upsert on the id you choose. Fields you leave out of a PUT on an existing record are kept.
curl -X PUT https://milebrain.com/api/v1/loads/l-tms-10442 \
-H "Authorization: Bearer $MB_KEY" -H "Content-Type: application/json" \
-d '{"customerName":"Acme Freight Brokers","origin":"Detroit, MI","destination":"Chicago, IL",
"pickupDate":"2026-09-12","deliveryDate":"2026-09-13","rate":"1850.00","miles":"283","status":"Booked","refNo":"PO 10442"}'
{"ok":true,"created":true,"load":{"id":"l-tms-10442", ...}}
Outstanding invoices for the accountant
curl "https://milebrain.com/api/v1/invoices" -H "Authorization: Bearer $MB_KEY" \
| jq '.items[] | select(.paidAt=="") | {invoiceNo, customer, total, invoicedAt}'
Fuel stops, in Python
import requests
r = requests.get("https://milebrain.com/api/v1/fuel", params={"from": "2026-07-01", "to": "2026-09-30"},
headers={"Authorization": "Bearer " + MB_KEY})
for f in r.json()["items"]:
print(f["date"], f.get("state"), f.get("gallons"), f.get("amount"))
Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | NO_KEY / BAD_KEY / REVOKED | No bearer token, an unknown key, or a key the owner revoked. |
| 403 | READ_ONLY / SUSPENDED | A write with a read-only key; a suspended company. |
| 404 | NOT_FOUND | No such record in this company. Another company’s record answers 404 too, never 403. |
| 402 | PLAN_LIMIT | The free plan’s one truck / one employee, or a paid plan at the seats it is billed for (a PayPal plan answers with its approveUrl). The cap is applied inside the write itself, so parallel creates cannot slip past it. |
| 429 | RATE_LIMITED | 60 a minute or 1,000 an hour on that key. |
Files instead of code
If what you actually need is a spreadsheet, the app already exports CSV for loads, fuel, repairs, the team, QuickBooks invoices and expenses, IFTA and payroll — under More → Exports. No key required.
The API is included on every plan — see pricing for the plan limits a key inherits, the features whose records it reads, and the help center for how those records get entered in the first place.
Free for your first truck.
Every feature, the API included, on the free tier. Upgrade when the fleet grows.
Start freeNo card needed