Skip to content
Skip to Content
Coder Docs

Regenerate user SSH key

PUT
/api/v2/users/{user}/gitsshkey

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

user*string

User ID, name, or me

Response Body

OK

application/json
  1. response
created_at?string
Formatdate-time
public_key?string

PublicKey is the SSH public key in OpenSSH format. Example: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3OmYJvT7q1cF1azbybYy0OZ9yrXfA+M6Lr4vzX5zlp\n" Note: The key includes a trailing newline (\n).

updated_at?string
Formatdate-time
user_id?string
Formatuuid

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X PUT \	"$CODER_URL/api/v2/users/{user}/gitsshkey" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "created_at": "2019-08-24T14:15:22Z",  "public_key": "string",  "updated_at": "2019-08-24T14:15:22Z",  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"}