- Where
- Console, Developers (API keys)
- Who can do it
- Owners
- Plans
- REST API is included in Growth, Scale and Enterprise
In detail
An API key lets one of your own systems act on your workspace: a web shop checkout, an order management system, a warehouse system or a reporting job. Give each of them its own key, so that you can switch one off without breaking the others.
Creating a key
- Open Developers from the Workspace group of the console menu and choose Create API key.
- Name it after where it will run, for example Storefront checkout or Warehouse system. The name appears in the request log and in the audit log, so it should be obvious what breaks if you revoke it.
- Choose its scope: read, write or admin. See scopes and sender-bound keys.
- Optionally choose Limit to one sender. The key then sees and books only that sender's parcels, cannot read vehicle positions or manage webhooks, and cannot have the admin scope.
- Create it, copy the key and store it. The dialog shows it in full this one time.
Keys start with ks_live_. They are sent on every request in the Authorization header as a bearer token: Authorization: Bearer ks_live_.... Only a hash of the key, its first characters and its last four are stored, so nobody can read it back later, including you.
Keeping keys safe
- Keep the key on a server, in its secrets or environment. Never put it in a web page, a phone app or a code repository.
- One key per system, named after that system.
- Give each key the lowest scope that does the job: read for reporting, write for booking, admin only for managing webhooks through the API.
- When someone who knew a key leaves, or a key may have been seen, create a new one, deploy it and then revoke the old one.
The key list
Developers lists every key with its name, scope, the sender it is limited to, who created it, when it was last used and how many calls it made in the last 24 hours. Revoking a key takes effect at once: anything still sending it is answered 401 and the key cannot be brought back. Revoked keys stay in the list, struck through, until you hide them.
Changes made through the API are recorded in the audit log under the key's name, and every call is in the request log on the same screen.