List public SSH keys for the authenticated user
GET
/user/keys
Lists the public SSH keys for the authenticated user’s GitHub account.
OAuth app tokens and personal access tokens (classic) need the read:public_key scope to use this endpoint.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”per_page
integer
The number of results per page (max 100). For more information, see “Using pagination in the REST API.”
page
integer
The page number of the results to fetch. For more information, see “Using pagination in the REST API.”
Responses
Section titled “Responses”Response
Media typeapplication/json
Array<object>
KeyKey
object
key
required
string
id
required
integer format: int64
url
required
string
title
required
string
created_at
required
string format: date-time
verified
required
boolean
read_only
required
boolean
last_used
string format: date-time
Examples
Exampledefault
[ { "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234", "id": 2, "url": "https://api.github.com/user/keys/2", "title": "ssh-rsa AAAAB3NzaC1yc2EAAA", "created_at": "2020-06-11T21:31:57Z", "verified": false, "read_only": false }, { "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJy931234", "id": 3, "url": "https://api.github.com/user/keys/3", "title": "ssh-rsa AAAAB3NzaC1yc2EAAB", "created_at": "2020-07-11T21:31:57Z", "verified": false, "read_only": false }]Headers
Section titled “Headers”Link
string
Example
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"Not modified
Requires authentication
Media typeapplication/json
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Examplegenerated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Forbidden
Media typeapplication/json
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Examplegenerated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Resource not found
Media typeapplication/json
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Examplegenerated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}