Docs menuFeatures

DOCS / FEATURES

API keys

A server or script can act for one organization, with no user behind it, by presenting an API key that belongs to that org.

Code: api/src/api_keys/. UI: web/src/features/api-keys/ApiKeysPanel.tsx.

The key

  • Format: rsk_ followed by 64 hex characters (256 random bits). The prefix marks it as a key so it can never be mistaken for a JWT.
  • Shown once, in the creation response. Only its SHA-256 hash is stored. The first 12 characters (rsk_a1b2c3d4) are kept in plaintext so lists can identify it.
  • last_used_at is updated on use, at most once a minute per key.

Metered requests

A request a key is authorized for counts one unit of its org's api_requests meter. Units are counted in memory and written every few seconds (see Billing). The org's billing page shows the month so far. When usage billing is configured, paying orgs are billed for it (see Billing).

Managing keys

The management endpoints need the manage_api_keys permission, which owners and admins hold and a custom role can:

Method Path Does
POST /api/orgs/{org_id}/api-keys {"name", "scopes"?, "expires_in_days"?} → {id, name, prefix, key, scopes, created_at, expires_at} — store key now
GET /api/orgs/{org_id}/api-keys Metadata only, including scopes and expires_at — never the key
GET /api/orgs/{org_id}/api-keys/scopes The grantable scopes with labels, the default scopes, and the longest expiry
DELETE /api/orgs/{org_id}/api-keys/{key_id} Revoke; takes effect on the key's next request

[ full guide ]

The rest of this guide comes with the repo.

  • Scopes
  • Expiry
  • Using a key
  • Opening more endpoints to keys
Get LaunchCrate