Skip to main content

Create a key

To create a key, you need one of these:
  • A browser session: boat login with no key, or the dashboard.
  • A key with the account.admin action, or an admin key. The new key cannot have more actions, more sandboxes or a later expiry than this key.
The create endpoint is POST https://boat.dev/api/v1/api-keys/scoped.
During a credential rollout, boat can turn off key creation for a short time. GET /api/v1/api-keys reports this in catalog.scopedCreationEnabled. While creation is off, the create endpoint returns a typed 503.
Full account access requires an explicit --preset admin. An admin key can also create more keys.
A key that never expires is still a scoped key. If it leaks, it works until you revoke or rotate it. Read Store, rotate and revoke. For the actions and presets, read Scopes. With the API:
The body takes name, ttl, preset or actions, sandboxIds and environmentIds. Pass at least one non-empty scope field. Full account access requires "preset":"admin". boat shows the secret one time only. In scripts, capture it like this:
You can also use the API Keys tab in the dashboard. It has expiry presets, action presets, a raw action picker, and sandbox and environment selectors.

Use the key

What a key cannot do

  • Create needs a browser session or an admin-scoped token. A credential that can make more credentials defeats least privilege.
  • Rotate and revoke need a browser session or a key that can create keys. Such a key can rotate or revoke itself and any key that it could create.
  • To approve an agent claim, you need a browser session. API keys cannot approve agent claims. This includes admin keys and legacy keys.
Use boat api-key create|rotate|revoke, or use the API Keys tab.

List

The CLI, the API, the SDKs and the dashboard can list keys. boat never returns the secrets. Each row shows:
  • The id, the name, the prefix and the last four characters
  • The scope and the expiry
  • The last use
  • The request total for the last 30 days
  • How many sandboxes and Agents the key created that still exist
boat labels expired keys and keys that expire soon. A key limited with --sandbox or --env gets an empty apiKeys list. A browser session, a CLI session or a key with no such limit gets the full list.
TypeScript
Python

See usage for one key

boat api-key usage <id> prints the 30-day request total and the count of live resources. These are the same numbers as in the list.
  • Add --verbose to see the split between sandboxes and Agents, and the list of created resources.
  • The matching API is GET /api-keys/{id}/usage.
  • Usage still works after you revoke the key, if you still have the id.
Revoke stops the secret. It does not delete the sandboxes or Agents that the key created.