GPG

Add a new GPG key

Changed on

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

Example:

$ curl -X POST -H "Content-Type: application/json" -d
'{"key": "<insert GPG Key>"}'
https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}/gpg-keys
post/users/{selected_user}/gpg-keys

Request

  • Base URL
    https://api.bitbucket.org/2.0
  • URL
    https://api.bitbucket.org/2.0/users/{selected_user}/gpg-keys
  • 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
keystring

The GPG key value in X format.

key_idstring

The unique identifier for the GPG key

fingerprintstring

The GPG key fingerprint.

parent_fingerprintstring

The fingerprint of the parent key. This value is null unless the current key is a subkey.

namestring

The user-defined label for the GPG key

expires_onstring date-time
created_onstring date-time
added_onstring date-time
last_usedstring date-time
subkeysGPGAccountKey[] circular

Response

The newly created GPG key.

typestring required
keystring

The GPG key value in X format.

key_idstring

The unique identifier for the GPG key

fingerprintstring

The GPG key fingerprint.

parent_fingerprintstring

The fingerprint of the parent key. This value is null unless the current key is a subkey.

namestring

The user-defined label for the GPG key

expires_onstring date-time
created_onstring date-time
added_onstring date-time
last_usedstring date-time
subkeysGPGAccountKey[] circular

Changes