GET/api/v1/projects/{project_id}/keys
list_api_keys
Lists the API keys of a project in id order, at most 100 per call, revoked and expired ones included.
- Call it
- to find a key’s id before revoking it, or to review who has access.
- Needs
- an admin key with
project_id, or a project key with scopekeys(its own project; the argument is ignored). - Returns
items(id,name,prefix,scopes, dates; never a key string) andnext_cursor: pass it ascursorfor the next page; null on the last page. The same asGET /api/v1/projects/{project_id}/keys.
Arguments
- object
-
cursorstring | nullnext_cursorof the previous page; leave it out for the first. -
limitinteger · int64 | nullPage size, 1 to 100; default 50.
1–100
-
project_idstring · uuid | nullThe project whose keys to list. An admin key must pass it; a project key’s own project is used and this is ignored.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
itemsarray of ApiKeyIn id order; revoked and expired keys included.
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.
-
next_cursorstring | nullPass as
cursorfor the next page;nullon the last page.
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
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: GET /api/v1/projects/{project_id}/keys