pydo.ssh_keys.create()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.ssh_keys.create(
body={
"public_key": "{your_public_key}",
"name": "My SSH Public Key",
},
)Description
To add a new SSH public key to your DigitalOcean account, send a POST request to /v2/account/keys. Set the name attribute to the name you wish to use and the public_key attribute to the full public key you are adding.
Parameters
idinteger optional read-onlyExample:
512189A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet.
fingerprintstring optional read-onlyExample:
3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:faA unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account.
public_keystring requiredExample:
ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V exampleThe entire public key string that was uploaded. Embedded into the root user's
authorized_keysfile if you include this key during Droplet creation.namestring requiredExample:
My SSH Public KeyA human-readable display name for this key, used to easily identify the SSH keys when they are displayed.
Request Sample
Response Example
More Information
See /v2/account/keys in the API reference for additional detail on responses, headers, parameters, and more.