API
48 endpoints, 76 operations. JSON in, JSON out. The reference data is open; anything about your containers needs a signed-in session.
This page is generated from the route registry and checked against the source in CI, so it cannot drift from what the server actually does.
Authentication
Today every private endpoint takes a signed-in session (the browser cookie), scoped to
your organisation. API keys are not accepted yet: a request carrying
Authorization: Bearer ds_live_…
is answered 401. API keys are coming soon: no plan issues them yet, and they
open once they carry scopes, an expiry and usage limits. No date is promised.
- Public
- No credentials.
- Signed in
- A signed-in session. Scoped to your organisation.
- Staff
- Platform operators only.
- Root
- Platform owner only.
- Signature
- Authenticated by request signature, not by a key.
Rate limits
Fixed window, keyed by your account when signed in and by IP otherwise. Every API response carries the remaining budget, not just the 429 — a client that can only discover the limit by hitting it has no way to back off politely.
| Budget | Per minute |
|---|---|
| catalogue Reference reads. | 240 |
| rates Pricing, which is the expensive path. | 60 |
| write Anything that changes state. | 20 |
| auth Deliberately tight: this is the surface a credential-stuffer hits. | 10 |
Limits are counted per server instance. Behind more than one instance the effective
ceiling is higher — the response says scope: per-instance so
you are not guessing.
Read the source field
Chassis, appointment and empty-return responses say whether the figures came from a terminal feed or from fixtures. The fixtures are deterministic and realistic, which is exactly why they must not be dispatched against. Empty-return acceptance is fixtures everywhere today: no provider publishes it through an API — it lives on per-terminal notice boards.
Reference
/api/ports
Rate budget catalogue — 240/min.
/api/ports/{code}
- code (path, required)
- UN/LOCODE, e.g. USLAX.
Rate budget catalogue — 240/min.
/api/carriers
Rate budget catalogue — 240/min.
/api/carriers/{scac}
- scac (path, required)
- Standard Carrier Alpha Code.
Rate budget catalogue — 240/min.
/api/lanes
Rate budget catalogue — 240/min.
/api/chassis
- port (query, required)
- UN/LOCODE.
- equipment (query)
- 20ft, 40ft, 40ft tri-axle, Genset or 45ft.
Rate budget catalogue — 240/min.
Read `source`: `fixtures` means no provider is connected and the numbers are generated. Do not dispatch against them.
/api/chassis/search
- equipment (query)
- Narrow to one equipment type.
- port (query)
- Comma-separated UN/LOCODEs. Omit to search every port.
- limit (query)
- Page size, 1–100. Defaults to 20.
Rate budget catalogue — 240/min.
Rows are declared pools, not a free count. `availabilityClaim` is false. DCLI and TRAC are partner-only and unverified. `count` is the total match; `results` is the page. An unknown port code is a 400.
/api/empty-returns
- port (query, required)
- UN/LOCODE.
- line (query)
- Ocean line SCAC.
- date (query)
- YYYY-MM-DD. Defaults to today.
Rate budget catalogue — 240/min.
The grid is fixtures unless a dated operator-declared restriction covers that terminal and line. Acceptance also changes same-day — confirm before dispatch.
/api/rates
Rate budget rates — 60/min.
/api/v1/drayage/rates
The customer price only. A missing read scope is 403. A zero plan allowance is 402 with X-RateLimit-* headers. An unknown lane or an unsupported filter is invalid_request and carries no price. POST /api/rates is unchanged.
Per diem
/api/v1/drayage/per-diem
- container (query, required)
- Container number the caller already has on a move.
- horizonDays (query)
- Integer 0–90. Omitted means 14. A bad value is invalid_request, not a clamp.
No ledger is built for a container that is not on file. The old /api/per-diem/{container} route is unchanged.
/api/per-diem/{container}
- container (path, required)
- ISO 6346 container number.
- horizonDays (query)
- How far to project, 0–90. Defaults to 14.
Rate budget catalogue — 240/min.
Each day carries `billed`. Days after `asOf` are a projection, not an invoice line. `billedBy.attributed` is false for leased or unrecognised boxes — do not bill off those figures.
/api/per-diem/export
Rate budget catalogue — 240/min.
Without a live events feed every row is projected. The dollars are the tariff model, not an invoice.
/api/per-diem/calendar
- year (query)
- 2000–2100. Defaults to the current year.
- coast (query)
- west, east, gulf or inland. West adds the ILWU contract days.
Rate budget catalogue — 240/min.
Published so a dispute can rest on something checkable. Holidays are computed from the rules that define them, not from a table that goes stale.
Operations
/api/v1/drayage/moves
status must be a real move status. Any other filter is invalid_request. Another organisation’s moves are absent, not copied from the demo seed.
/api/v1/drayage/tracking
- container (query, required)
- Container number or move id the caller already tracks.
Does not call a terminal feed. feedQueried is false. A missing container and another organisation’s container are both not_found.
/api/moves
Rate budget catalogue — 240/min.
An illegal status jump is refused rather than corrupting the per-diem clocks downstream.
/api/tracking
Rate budget catalogue — 240/min.
A container belonging to another organisation answers 404, byte-identical to one that does not exist.
/api/appointments
Rate budget write — 20/min.
This records your note of a slot; it does not book one. A user_reported record answers provenance declared — not a terminal confirmation.
/api/chassis/pool
Rate budget write — 20/min.
The label is always declared. The body cannot set a free count. DCLI and TRAC stay partner-only.
/api/bookings
Rate budget write — 20/min.
A new booking is `requested` until the carrier accepts (staff record the carrier's reference) and operations confirm; its moves exist only from `confirmed`. An unanswered request expires after 48 hours. PATCH takes an `idempotencyKey` (or Idempotency-Key header). POST answers 402 with code "quota_exceeded" when the containers would take the organisation past its plan's moves for this UTC month, and 402 with code "shipment_cap" plus a usage object when they would pass the platform ceiling of 100 shipments in that month. Open requests count toward both.
/api/quotes
Rate budget write — 20/min.
/api/exceptions
/api/alerts
Account
/api/account
/api/preferences
/api/team
An invite link works once and expires after an hour. It is emailed to the invitee; only when no email could be sent does the POST response carry it, for the inviter to pass on. It is never stored — only its hash.
/api/developer
API keys are coming soon: no route accepts one yet, so issuing a key answers 403 `coming_soon`. Keys issued earlier stay listed and revocable. Webhook endpoints work on plans that sell webhook move events.
/api/feedback
/api/feedback/{id}
- id (path, required)
- Thread id.
Billing
/api/billing
While the billing decision line is empty, POST answers 503 not configured and does not open a subscription. A checkout can only become active on a gateway confirmation.
/api/billing/webhook
Rate budget write — 20/min.
HMAC-SHA256 over `<timestamp>.<raw body>`, five-minute tolerance, idempotent by event id. With no secret configured it answers 503 and refuses everything rather than trusting it.
Authentication
/api/auth/signup
Rate budget auth — 10/min.
Answers 503 when Basefyio auth is not configured. Without tokens from Basefyio (email verification pending) it points to /verify instead of signing in.
/api/auth/invite
Rate budget auth — 10/min.
The verified token’s email must match the invite. An address that already has an account in any organisation is refused; accounts are never moved between organisations.
/api/auth/login
Rate budget auth — 10/min.
Every access token is verified (RS256, pinned realm issuer, JWKS) on every request. Answers 503, never "wrong password", when auth is not configured.
/api/auth/logout
/api/auth/forgot-password
Rate budget auth — 10/min.
Answers identically whether or not the account exists, so it cannot be used to discover which addresses are registered.
/api/auth/reset-password
Rate budget auth — 10/min.
Basefyio checks the code; it is single-use and expires.
/api/auth/verify
Rate budget auth — 10/min.
/api/auth/resend-verification
Administration
/api/admin/audit
/api/admin/users
/api/admin/preflight
Rate budget catalogue — 240/min.
Answers 200 whether or not it is ready — a report, not a probe. Staff-only because the checks name which secrets are unset.
/api/admin/pricing
/api/admin/per-diem-rules
/api/admin/empty-returns
System
/api/health
Public body is exactly ok, storage and email. marginBasePct and the stat objects (storage, email, checks, cache) are staff-only; provider routing is inside the root stats object.
/api/cron/per-diem-scan
Safe to run hourly: the alert ledger de-duplicates per container, per severity, per day. Also accepts a CRON_SECRET bearer token instead of a staff session.
Webhooks
Register an endpoint under Developer to receive move events. Deliveries are signed so you can tell ours from anyone else's POST:
X-DrayageScanner-Event: move.gated_out
X-DrayageScanner-Timestamp: 1789000000000
X-DrayageScanner-Signature: sha256=<hmac>
The HMAC is SHA-256 over <timestamp>.<raw body> with your
endpoint's secret. Verify it over the bytes you received — parsing the JSON and
re-serialising it changes them and the signature will not match.
Endpoints must be https. One that fails five times in a row is disabled automatically; a single success clears the streak.
Errors
Errors are JSON with an error string.
| 400 | The request is wrong in a way retrying will not fix. |
| 401 | No credentials, or they did not verify. |
| 403 | Signed in, but not allowed. |
| 404 | No such record — including one that belongs to another organisation. We do not distinguish the two, because doing so would confirm the id exists. |
| 429 | Rate limited. Honour Retry-After. |
| 503 | A dependency we need is not configured or not answering. |