SSH

Update a SSH key

Changed on

Updates a specific SSH public key on a user's account

Note: Only the 'comment' field can be updated using this API. To modify the key or comment values, you must delete and add the key again.

Example:

$ curl -X PUT -H "Content-Type: application/json" -d '{"label": "Work key"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a}
put/users/{selected_user}/ssh-keys/{key_id}

Request

  • Base URL
    https://api.bitbucket.org/2.0
  • URL
    https://api.bitbucket.org/2.0/users/{selected_user}/ssh-keys/{key_id}
  • Auth
    • OAuth 2
      Authorization code: https://bitbucket.org/site/oauth2/authorize
      Token URL: https://bitbucket.org/site/oauth2/access_token scopes: account:write
    • or HTTP basic
    • or API key in header Authorization

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 updated 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.

Changes

    • warning

      removed the request property ///

    • warning

      removed the optional property /// from the response with the status

    • info

      api tag SSH added

    • info

      api tag Ssh removed

    • info

      added the new optional request property /

    • info

      added the new optional request property /

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status