Get API key by ID
GET
CoderSessionTokenheader
Coder-Session-Token<token>user*stringUser ID, name, or me
keyid*stringKey ID
Format
stringOK
application/json- response
allow_list?array<>created_at*stringFormat
date-timeexpires_at*stringFormat
date-timeid*stringlast_used*stringFormat
date-timelifetime_seconds*integerlogin_type*stringValue in
"password""github""oidc""token"scope?stringDeprecated: use Scopes instead.
Value in
"all""application_connect"scopes?array<>token_name*stringupdated_at*stringFormat
date-timeuser_id*stringFormat
uuidThe samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X GET \ "$CODER_URL/api/v2/users/{user}/keys/{keyid}" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN"Example Response200
{ "allow_list": [ { "id": "string", "type": "*" } ], "created_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "id": "string", "last_used": "2019-08-24T14:15:22Z", "lifetime_seconds": 0, "login_type": "password", "scope": "all", "scopes": [ "all" ], "token_name": "string", "updated_at": "2019-08-24T14:15:22Z", "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"}