Authentication

Two credentials, two different places they're allowed to live.

1. Your fleet's API key (server-side only)

LotGrids issues two API keys per fleet — live and test — both shown in your Partner Dashboard's API Access tab, clearly labeled so you can't mix them up. A live key looks like this:

lg_live_<fleetId>.<64-character secret>

A test key is identical except for the prefix — lg_test_<fleetId>.<secret> — and routes every call to a fully isolated sandbox instead of your real fleet. See Testing & Sandbox for what's different in test mode.

Send it as a header on every server-to-server endpoint — Mint Driver Token, Add Driver, Update Driver, Distribute to Driver, Zero Driver Balance, and Set Fleet Auto-Zero:

Authorization: ApiKey lg_live_f_8f21a9.9c2e...

Never embed either key in a driver-facing app, mobile binary, or any client-side code. They must only ever be called from your own backend. If you suspect one has leaked, regenerate it immediately from the Partner Dashboard — the previous key stops working the instant you do (regenerating your live key doesn't affect your test key, and vice versa).

2. The driver token (server or driver app)

Your backend exchanges the API key for a driver token, scoped to exactly one driver's email, by calling Mint Driver Token. Hand that token to the driver's app session — it's what authenticates every subsequent call:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

The token expires 30 minutes after it's minted. It is not single-use — a driver app can call Quote and then Start with the same token as long as it's still valid. There is no refresh flow: once expired, just have your backend mint a new one (the API key itself doesn't expire, only rotates when you regenerate it).

A driver token can only ever act on the driver email it was minted for. If a request's driverEmail doesn't match the token's scope, the call fails with token_scope_mismatch — one driver's token can never touch another driver's wallet, even by accident.

CredentialHeaderUsed byLifetime
API keyAuthorization: ApiKey <key>Your backend, for Mint Driver Token onlyUntil you regenerate it
Driver tokenAuthorization: Bearer <token>Your driver app, for Quote/Start30 minutes