API keys
Credentials for agents, CI, and integrations. A user key acts as the person who owns it; a service key is a machine identity. Secrets are shown once at creation — thereafter only a last-4 hint is returned.
Related guides: Authentication
Attributes
idstringrequiredobjectstringrequirednamestringrequiredprefixstringrequiredlast4stringrequiredmodestringrequiredPossible values:
live,testscopesarray of stringrequiredkindstringrequiredA user key acts as a person; a service key is a machine identity.
Possible values:
user,serviceacts_asstring | nullrequiredThe user a user key acts as (null for a service key).
created_bystring | nullrequiredWho minted the key.
last_used_attimestamprequiredrevoked_attimestamprequiredcreated_attimestamprequired
List API keys
GET/v1/api_keys
Lists the active org's API keys (newest first). Secrets are never returned — only `prefix` and `last4` for identification.
Requires an API key (bearer), scoped to the active org.
Create an API key
POST/v1/api_keys
Mints a livemode secret key for the active org. The full `secret` is returned exactly once in this response and cannot be retrieved later — store it now.
Requires an API key (bearer), scoped to the active org. Supports idempotency keys.
Body parameters
namestringrequiredmax 120 charsscopesarray of stringoptionalservicebooleanoptionalMint a SERVICE key (a machine identity, no acting user). Default is a USER key that acts as the caller — its actions are authored as you (09 §3).
metadataobjectoptionalArbitrary key/value map; merge-on-write (§6).
Returns
201The created key, including its one-time secret.
Failures use the standard error envelope with a closed set of codes.
Revoke an API key
DELETE/v1/api_keys/{id}
Permanently revokes a key. Already-revoked or unknown keys return 404.
Requires an API key (bearer), scoped to the active org. Supports idempotency keys.
Path parameters
idstringrequired