whoami
Tells which API key this connection uses.
- Call it
- first, to learn whether the key is an admin key or a project key, which project it works in and what it may do.
- Needs
- any valid key, nothing else.
- Returns
key_id,name,kind(adminorproject),project_id(null for an admin key),scopesandexpires_at(null: never); the same asGET /api/v1/whoami.
Arguments
No arguments.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
expires_atstring · date-time | nullWhen the key stops working;
null: never. -
key_idstring · uuidThe key’s id: what revoking it takes.
-
kindKeyKindThe kind of an API key.
adminEverything, projects and admin keys included.projectOne project, within its scopes. -
namestringThe name its owner gave it.
-
project_idstring · uuid | nullThe key’s project;
nullfor an admin key. -
scopesarray of KeyScopeWhat the key may do. An admin key has every scope, and may manage projects and admin keys besides.
Definitions
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/whoami