Bitbucket Pipelines GPG API
The GPG resource allows you to manage GPG keys.
The GPG resource allows you to manage GPG keys.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/bitbucket-pipelines:bitbucket-pipelines-gpg-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Bitbucket GPG API
description: Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
version: '2.0'
termsOfService: https://www.atlassian.com/legal/customer-agreement
contact:
name: Bitbucket Support
url: https://support.atlassian.com/bitbucket-cloud/
email: support@bitbucket.org
servers:
- url: https://api.bitbucket.org/2.0
tags:
- name: GPG
description: The GPG resource allows you to manage GPG keys.
paths:
/users/{selected_user}/gpg-keys:
parameters:
- name: selected_user
in: path
description: 'This can either be an Atlassian Account ID OR the UUID of the account,
surrounded by curly-braces, for example: `{account UUID}`.
'
required: true
schema:
type: string
get:
tags:
- GPG
description: 'Returns a paginated list of the user''s GPG public keys.
The `key` and `subkeys` fields can also be requested from the endpoint.
See Partial Responses for more details.'
summary: List GPG keys
responses:
'200':
description: A list of the GPG keys associated with the account.
content:
application/json:
schema:
$ref: '#/components/schemas/paginated_gpg_user_keys'
example:
page: 1
pagelen: 10
size: 1
values:
- added_on: '2024-09-24T12:09:33.154081+00:00'
created_on: '2018-03-20T13:09:04.207005+00:00'
expires_on: null
fingerprint: h4m26ppxrol7blr7spbc7lhyymokdbnkxd06kzrt
key_id: ymokdbnkxd06kzrt
last_used: '2024-09-25T15:18:05.196003+00:00'
links:
self:
href: https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}/gpg-keys/H4M26PPXROL7BLR7SPBC7LHYYMOKDBNKXD06KZRT
name: Alice's OpenPGP key
owner:
display_name: Mark Adams
links:
avatar:
href: https://bitbucket.org/account/markadams-atl/avatar/32/
html:
href: https://bitbucket.org/markadams-atl/
self:
href: https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}
type: user
username: markadams-atl
nickname: markadams-atl
uuid: '{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}'
parent_fingerprint: null
type: gpg_key
'403':
description: If the specified user's keys are not accessible to the current user
'404':
description: If the specified user does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- account
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- read:gpg-key:bitbucket
x-atlassian-auth-types:
- api-token
operationId: getUsersBySelectedUserGpgKeys
x-operation-id-source: derived
post:
tags:
- GPG
description: '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": ""}''
https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}/gpg-keys
```'
summary: Add a new GPG key
responses:
'201':
description: The newly created GPG key.
content:
application/json:
schema:
$ref: '#/components/schemas/GPG_account_key'
example:
added_on: '2024-09-24T12:09:33.154081+00:00'
created_on: '2018-03-20T13:09:04.207005+00:00'
expires_on: null
fingerprint: h4m26ppxrol7blr7spbc7lhyymokdbnkxd06kzrt
key_id: ymokdbnkxd06kzrt
last_used: '2024-09-25T15:18:05.196003+00:00'
links:
self:
href: https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}/gpg-keys/H4M26PPXROL7BLR7SPBC7LHYYMOKDBNKXD06KZRT
name: Alice's OpenPGP key
owner:
display_name: Mark Adams
links:
avatar:
href: https://bitbucket.org/account/markadams-atl/avatar/32/
html:
href: https://bitbucket.org/markadams-atl/
self:
href: https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}
type: user
username: markadams-atl
nickname: markadams-atl
uuid: '{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}'
parent_fingerprint: null
type: gpg_key
'400':
description: If the submitted key or related value is invalid
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'403':
description: If the current user does not have permission to add a key for the specified user
'404':
description: If the specified user does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- account:write
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- read:gpg-key:bitbucket
- write:gpg-key:bitbucket
x-atlassian-auth-types:
- api-token
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GPG_account_key'
description: The new GPG key object.
operationId: postUsersBySelectedUserGpgKeys
x-operation-id-source: derived
/users/{selected_user}/gpg-keys/{fingerprint}:
parameters:
- name: fingerprint
in: path
description: 'A GPG key fingerprint.
'
required: true
schema:
type: string
- name: selected_user
in: path
description: 'This can either be an Atlassian Account ID OR the UUID of the account,
surrounded by curly-braces, for example: `{account UUID}`.
'
required: true
schema:
type: string
delete:
tags:
- GPG
description: Deletes a specific GPG public key from a user's account.
summary: Delete a GPG key
responses:
'204':
description: The key has been deleted
'400':
description: If the submitted key or related value is invalid
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'403':
description: If the current user does not have permission to delete a key for the specified user, or the submitted key is a subkey
'404':
description: If the specified key does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- account:write
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- delete:gpg-key:bitbucket
x-atlassian-auth-types:
- api-token
operationId: deleteUsersBySelectedUserGpgKeysByFingerprint
x-operation-id-source: derived
get:
tags:
- GPG
description: 'Returns a specific GPG public key belonging to a user.
The `key` and `subkeys` fields can also be requested from the endpoint.
See Partial Responses for more details.'
summary: Get a GPG key
responses:
'200':
description: The specific GPG key matching the user and fingerprint.
content:
application/json:
schema:
$ref: '#/components/schemas/GPG_account_key'
example:
added_on: '2024-09-24T12:09:33.154081+00:00'
created_on: '2018-03-20T13:09:04.207005+00:00'
expires_on: null
fingerprint: h4m26ppxrol7blr7spbc7lhyymokdbnkxd06kzrt
key_id: ymokdbnkxd06kzrt
last_used: '2024-09-25T15:18:05.196003+00:00'
links:
self:
href: https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}/gpg-keys/H4M26PPXROL7BLR7SPBC7LHYYMOKDBNKXD06KZRT
name: Alice's OpenPGP key
owner:
display_name: Mark Adams
links:
avatar:
href: https://bitbucket.org/account/markadams-atl/avatar/32/
html:
href: https://bitbucket.org/markadams-atl/
self:
href: https://api.bitbucket.org/2.0/users/{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}
type: user
username: markadams-atl
nickname: markadams-atl
uuid: '{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}'
parent_fingerprint: null
type: gpg_key
'403':
description: If the specified user's keys are not accessible to the current user
'404':
description: If the specified user does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- account
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- read:gpg-key:bitbucket
x-atlassian-auth-types:
- api-token
operationId: getUsersBySelectedUserGpgKeysByFingerprint
x-operation-id-source: derived
components:
schemas:
paginated_gpg_user_keys:
type: object
title: Paginated GPG User Keys
description: A paginated list of GPG keys.
properties:
size:
type: integer
description: Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.
minimum: 0
page:
type: integer
description: Page number of the current results. This is an optional element that is not provided in all responses.
minimum: 1
pagelen:
type: integer
description: Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.
minimum: 1
next:
type: string
description: Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.
format: uri
previous:
type: string
description: Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.
format: uri
values:
type: array
items:
$ref: '#/components/schemas/GPG_account_key'
minItems: 0
uniqueItems: true
additionalProperties: false
object:
type: object
description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
properties:
type:
type: string
required:
- type
additionalProperties: true
discriminator:
propertyName: type
account_links:
type: object
title: Account Links
description: Links related to an Account.
properties:
avatar:
$ref: '#/components/schemas/link'
additionalProperties: true
account:
allOf:
- $ref: '#/components/schemas/object'
- type: object
title: Account
description: An account object.
properties:
links:
$ref: '#/components/schemas/account_links'
created_on:
type: string
format: date-time
display_name:
type: string
uuid:
type: string
additionalProperties: true
link:
type: object
title: Link
description: A link to a resource related to this object.
properties:
href:
type: string
format: uri
name:
type: string
additionalProperties: false
GPG_account_key:
allOf:
- $ref: '#/components/schemas/object'
- type: object
title: GPG Account Key
description: Represents a GPG public key for a user.
properties:
owner:
$ref: '#/components/schemas/account'
key:
type: string
description: The GPG key value in X format.
key_id:
type: string
description: The unique identifier for the GPG key
fingerprint:
type: string
description: The GPG key fingerprint.
parent_fingerprint:
type: string
description: The fingerprint of the parent key. This value is null unless the current key is a subkey.
name:
type: string
description: The user-defined label for the GPG key
expires_on:
type: string
format: date-time
created_on:
type: string
format: date-time
added_on:
type: string
format: date-time
last_used:
type: string
format: date-time
subkeys:
type: array
items:
$ref: '#/components/schemas/GPG_account_key'
minItems: 0
uniqueItems: true
links:
type: object
properties:
self:
type: object
title: Link
description: A link to a resource related to this object.
properties:
href:
type: string
format: uri
name:
type: string
additionalProperties: false
additionalProperties: false
additionalProperties: true
error:
type: object
title: Error
description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
properties:
type:
type: string
error:
type: object
properties:
message:
type: string
detail:
type: string
data:
type: object
description: Optional structured data that is endpoint-specific.
properties: {}
additionalProperties: true
required:
- message
additionalProperties: false
required:
- type
additionalProperties: true
securitySchemes:
basic:
type: http
scheme: basic
description: Basic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth is available only with username and app password as credentials.
oauth2:
type: oauth2
flows:
authorizationCode:
scopes:
repository: Read your repositories
repository:write: Read and modify your repositories
repository:admin: Administer your repositories
repository:delete: Delete your repositories
project: Read your workspace's project settings and read repositories contained within your workspace's projects
project:admin: Read and modify settings for projects in your workspace
email: Read your account's primary email address
account: Read your account information
account:write: Read and modify your account information
team: Read your team membership information
team:write: Read and modify your team membership information
pipeline: Access your repositories' build pipelines
pipeline:write: Access and rerun your repositories' build pipelines
pipeline:variable: Access your repositories' build pipelines and configure their variables
runner: Access your workspaces/repositories' runners
runner:write: Access and edit your workspaces/repositories' runners
test: Access your workspaces/repositories' test
test:write: Access and edit your workspaces/repositories' test
pullrequest: Read your repositories and their pull requests
pullrequest:write: Read and modify your repositories and their pull requests
webhook: Read and modify your repositories' webhooks
issue: Read your repositories' issues
issue:write: Read and modify your repositories' issues
snippet: Read your snippets
snippet:write: Read and modify your snippets
wiki: Read and modify your repositories' wikis
authorizationUrl: https://bitbucket.org/site/oauth2/authorize
tokenUrl: https://bitbucket.org/site/oauth2/access_token
description: OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).
api_key:
name: Authorization
type: apiKey
description: API Keys can be used as Basic HTTP Authentication credentials and provide a substitute for the account's actual username and password. API Keys are only available to team accounts and there is only 1 key per account. API Keys do not support scopes and have therefore access to all contents of the account.
in: header
x-revision: 1e0692ed4864
x-atlassian-narrative:
documents:
# --- truncated at 32 KB (128 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bitbucket-pipelines/refs/heads/main/openapi/bitbucket-pipelines-gpg-api-openapi.yml