v2

Swagger 2.02026-08-01331211921.0 KB
SSH

Add a new SSH key

Adds a new SSH public key to the specified user account and returns the resulting key.

Example:

$ curl -X POST -H "Content-Type: application/json" -d '{"key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY user@myhost"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys
post/users/{selected_user}/ssh-keys

Query parameters

expires_onstring

The date or date-time of when the key will expire, in ISO-8601 format. Example: YYYY-MM-DDTHH:mm:ss.sssZ

Request body

typestring required
uuidstring

The SSH key's immutable ID.

keystring

The SSH public key value in OpenSSH format.

commentstring

The comment parsed from the SSH key (if present)

labelstring

The user-defined label for the SSH key

created_onstring date-time
last_usedstring date-time
expires_onstring date-time
fingerprintstring

The SSH key fingerprint in SHA-256 format.

Response

The newly created SSH key.

typestring required
uuidstring

The SSH key's immutable ID.

keystring

The SSH public key value in OpenSSH format.

commentstring

The comment parsed from the SSH key (if present)

labelstring

The user-defined label for the SSH key

created_onstring date-time
last_usedstring date-time
expires_onstring date-time
fingerprintstring

The SSH key fingerprint in SHA-256 format.