Skip to content
Skip to Content
Coder Docs

Get API key by ID

GET
/api/v2/users/{user}/keys/{keyid}

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

user*string

User ID, name, or me

keyid*string

Key ID

Formatstring

Response Body

OK

application/json
  1. response
allow_list?array<>
created_at*string
Formatdate-time
expires_at*string
Formatdate-time
id*string
last_used*string
Formatdate-time
lifetime_seconds*integer
login_type*string
Value in"password""github""oidc""token"
scope?string

Deprecated: use Scopes instead.

Value in"all""application_connect"
scopes?array<>
token_name*string
updated_at*string
Formatdate-time
user_id*string
Formatuuid

The 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"}