List
List All SSH Keys
/v2/account/keys
To list all of the keys in your account, send a GET request to /v2/account/keys
. The response will be a JSON object with a key set to ssh_keys
. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes.
Query Parameters
Returns
List All SSH Keys
curl https://api.digitalocean.com/v2/account/keys \
-H "Authorization: Bearer $DIGITALOCEAN_ACCESS_TOKEN"
{
"meta": {
"total": 1
},
"links": {
"pages": {
"last": "https://api.digitalocean.com/v2/images?page=2",
"next": "https://api.digitalocean.com/v2/images?page=2"
}
},
"ssh_keys": [
{
"name": "My SSH Public Key",
"public_key": "ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example"
}
]
}
Returns Examples
{
"meta": {
"total": 1
},
"links": {
"pages": {
"last": "https://api.digitalocean.com/v2/images?page=2",
"next": "https://api.digitalocean.com/v2/images?page=2"
}
},
"ssh_keys": [
{
"name": "My SSH Public Key",
"public_key": "ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example"
}
]
}