Prerequisites:
- These operations are available on every plan.
- For workspace API keys: an account API key with the
X-Paradime-Workspaceheader, or a workspace API key. For account API keys: an account API key, with noX-Paradime-Workspaceheader needed. - The API keys admin capability group, and every capability group that you give the new key.
Operations
Never more access than the calling key
Every key the API creates, lists, or revokes stays within the access of the key that calls it:- Capability groups. Each group you give must be one the calling key holds in full. Otherwise the call fails with
MISSING_CAPABILITYon that group’s input path, such as["input", "capabilityGroups", "1"]. Give at least one group. Pass groups by their enum value, such asMANAGE_BOLT_ADMINfor Bolt admin: see Capability groups. Every group can go on both key types, except Workspace admin, which only account keys can hold. - Workspaces. Each workspace of a new account key must be one the calling key can reach. Otherwise the call fails with
MISSING_CAPABILITYon["input", "workspaceUids", "<index>"]. A workspace that doesn’t exist gets the same error, so the answer never shows which workspaces exist. - Expiry.
expiresAtmust be in the future, and no later than the calling key’s own expiry. If the calling key expires,expiresAtis required. When you generate an account key in Paradime, Lifetime (days) is required, so that key expires, and every key it creates must sendexpiresAt. LeaveexpiresAtout for a key that never expires, which only a calling key that never expires can create. - Lists and revokes. The lists show only the keys the calling key could revoke: keys with no capability, and for account keys no workspace, beyond its own.
totalCountcounts only those keys. An account key’sworkspaceslists only the workspaces the calling key can reach.
Create a workspace API key
createApiKey creates a key in the targeted workspace. The name must be unique among the workspace’s working keys, ignoring spaces at the start and end.
Example response
Example response
prdm_wsp_. Send it as Authorization: Bearer <token>. A workspace key is bound to its workspace, so it needs no X-Paradime-Workspace header. See Authentication.
Create an account API key
createCompanyApiKey creates an account key that can reach the workspaces in workspaceUids. It needs an account key. The name must be unique among the account’s active account keys.
prdm_cmp_. Send it as Authorization: Bearer <token>, with X-Paradime-Workspace to pick the workspace of a workspace-level call.
List and revoke keys
Workspace.apiKeys lists the targeted workspace’s working keys, oldest first, and companyApiKeys the account’s active account keys. Neither returns a token. lastUsedAt shows when a key last made a request.
revokeApiKey and revokeCompanyApiKey take the key’s id, and the key stops working at once. The calling key can revoke itself. Revoking a key again, or a key that already expired, succeeds and writes no new audit entry. A revoked workspace key reads expiresAt as the moment it was revoked. A revoked account key has revokedAt.
Rotate a key
To rotate a key, create its successor, move your clients to it, then revoke the old key.1
Create the successor
Call
createApiKey or createCompanyApiKey with the same capability groups and, for an account key, the same workspaces. Give it a new name, such as one with the date: a name that a working key holds is a CONFLICT.2
Move your clients
Store the new token, and update every script, CI job, and secret store that uses the old one.
3
Revoke the old key
Call
revokeApiKey or revokeCompanyApiKey with the old key’s id. The old key can make this call itself, as its last request.A key can’t create a key that expires later than itself. To rotate to a later expiry, create the successor with a key that expires later, or never, or generate it in Paradime. The lists return each key’s capabilities, such as
bolt:schedules:list, not its capability groups, so keep the groups each key needs in your own configuration.Errors
These are the cases specific to API keys. For the error format and the codes every area shares, see Errors.Related
- API keys: account and workspace API keys, and how to generate them in Paradime.
- Authentication: send a key with each request.
- API keys settings: where API keys live in Paradime.