POST /users/{selected_user}/gpg-keys

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

Servers

Path parameters

Name Type Required Description
selected_user String Yes

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
subkeys[] Array No
fingerprint String No

The GPG key fingerprint.

created_on String No
links Object No
links.self Object No

A link to a resource related to this object.

links.self.href String No
links.self.name String No
key_id String No

The unique identifier for the GPG key

parent_fingerprint String No

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

added_on String No
comment String No

The comment parsed from the GPG key (if present)

expires_on String No
name String No

The user-defined label for the GPG key

key String No

The GPG key value in X format.

type String Yes
last_used String No

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.