Update
Update an SSH Key's Name
/v2/account/keys/{ssh_key_identifier}
To update the name of an SSH key, send a PUT request to either /v2/account/keys/$SSH_KEY_ID or /v2/account/keys/$SSH_KEY_FINGERPRINT. Set the name attribute to the new name you want to use.
Path Parameters
Body Parameters
name: optional string
A human-readable display name for this key, used to easily identify the SSH keys when they are displayed.
Returns
Update an SSH Key's Name
curl https://api.digitalocean.com/v2/account/keys/$SSH_KEY_IDENTIFIER \
-X PUT \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $DIGITALOCEAN_ACCESS_TOKEN" \
-d '{
"name": "My SSH Public Key"
}'
{
"ssh_key": {
"name": "My SSH Public Key",
"public_key": "ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
"id": 512189,
"fingerprint": "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa"
}
}Returns Examples
{
"ssh_key": {
"name": "My SSH Public Key",
"public_key": "ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
"id": 512189,
"fingerprint": "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa"
}
}