v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
users

Create a public SSH key for the authenticated user

Adds a public SSH key to the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the write:public_key scope to use this endpoint.

post/user/keys

Request body

titlestring

A descriptive name for the new key.

keystring required

The public SSH key to add to your GitHub account.

Example request

{
  "title": "Personal MacBook Air"
}

Response

Response

keystring required
idinteger required
urlstring required
titlestring required
created_atstring date-time required
verifiedboolean required
read_onlyboolean required
last_usedstring date-time nullable