DELETE/api/v1/admin/keys/{key_id}
revoke_admin_key
Revokes an admin key for good, this connection’s own included.
- Call it
- when an admin key leaked or is no longer used.
- Needs
- an admin key, another usable admin key besides the one revoked (the last one is refused with
conflict), andconfirm: true; without it the call changes nothing and tells what it would do. - Returns
outcome(would_revoke,revoked,already_revoked),effectin words and the key aslist_admin_keysshows it after the call; the API’sDELETE /api/v1/admin/keys/{key_id}answers 204.
Arguments
- object
-
key_idstring · uuidrequiredThe admin key’s id, as
list_admin_keysgives it. -
confirmbooleantruerevokes the key. Without it the call only tells what would happen and changes nothing.default
false
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
effectstringThe outcome in words, for the agent and its user.
-
keyApiKeyThe key as it is now.
10 fields
- ApiKey object · all fields required
-
created_atstring · date-time -
expires_atstring · date-time | nullnull: never. -
idstring · uuidWhat revoking the key takes.
-
kindKeyKindThe kind of an API key.
adminEverything, projects and admin keys included.projectOne project, within its scopes. -
last_used_atstring · date-time | nullWhen the key was last used;
null: not recorded yet. -
namestring -
prefixstringThe public part of the key string,
pw_<adm|prj>_<prefix>_...: how to tell which key a client holds. -
project_idstring · uuid | nullThe key’s project;
nullfor an admin key. -
revoked_atstring · date-time | nullWhen the key was revoked;
nullwhile it is not. -
scopesarray of KeyScopeWhat the key may do; every scope for an admin key.
-
outcomeRevocationOutcomeWhat a revocation did.
would_revokeA dry run: nothing changed; a call withconfirm: truerevokes.revokedRevoked now.already_revokedRevoked before; nothing changed.
Definitions
ApiKey
An API key, without its secret (list_api_keys, list_admin_keys).
- object · all fields required
-
created_atstring · date-time -
expires_atstring · date-time | nullnull: never. -
idstring · uuidWhat revoking the key takes.
-
kindKeyKindThe kind of an API key.
adminEverything, projects and admin keys included.projectOne project, within its scopes. -
last_used_atstring · date-time | nullWhen the key was last used;
null: not recorded yet. -
namestring -
prefixstringThe public part of the key string,
pw_<adm|prj>_<prefix>_...: how to tell which key a client holds. -
project_idstring · uuid | nullThe key’s project;
nullfor an admin key. -
revoked_atstring · date-time | nullWhen the key was revoked;
nullwhile it is not. -
scopesarray of KeyScopeWhat the key may do; every scope for an admin key.
KeyKind
The kind of an API key.
string · enum
admin Everything, projects and admin keys included.
project One project, within its scopes.
KeyScope
A right of a project key. An admin key has all of them.
string · enum
- read
- write
- send
- keys
RevocationOutcome
What a revocation did.
string · enum
would_revoke A dry run: nothing changed; a call with confirm: true revokes.
revoked Revoked now.
already_revoked Revoked before; nothing changed.
Errors
A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors
HTTP API
The same operation over HTTP: DELETE /api/v1/admin/keys/{key_id}