swagger: '2.0'
info:
title: Bitbucket Addon 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
host: api.bitbucket.org
basePath: /2.0
schemes:
- https
consumes:
- application/json
produces:
- application/json
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
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](/cloud/bitbucket/rest/intro/#partial-response) for more details.'
summary: List GPG keys
responses:
'200':
description: A list of the GPG keys associated with the account.
schema:
$ref: '#/definitions/paginated_gpg_user_keys'
examples:
application/json:
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
schema:
$ref: '#/definitions/error'
parameters: []
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
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": "<insert GPG 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.
schema:
$ref: '#/definitions/GPG_account_key'
examples:
application/json:
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
schema:
$ref: '#/definitions/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
schema:
$ref: '#/definitions/error'
parameters:
- name: _body
in: body
description: The new GPG key object.
required: false
schema:
$ref: '#/definitions/GPG_account_key'
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
/users/{selected_user}/gpg-keys/{fingerprint}:
parameters:
- name: fingerprint
in: path
description: 'A GPG key fingerprint.
'
required: true
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
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
schema:
$ref: '#/definitions/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
schema:
$ref: '#/definitions/error'
parameters: []
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
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](/cloud/bitbucket/rest/intro/#partial-response) for more details.'
summary: Get a GPG key
responses:
'200':
description: The specific GPG key matching the user and fingerprint.
schema:
$ref: '#/definitions/GPG_account_key'
examples:
application/json:
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
schema:
$ref: '#/definitions/error'
parameters: []
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
definitions:
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
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
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: type
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: '#/definitions/GPG_account_key'
minItems: 0
uniqueItems: true
additionalProperties: false
GPG_account_key:
allOf:
- $ref: '#/definitions/object'
- type: object
title: GPG Account Key
description: Represents a GPG public key for a user.
properties:
owner:
$ref: '#/definitions/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.
comment:
type: string
description: The comment parsed from the GPG key (if present)
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: '#/definitions/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
account:
allOf:
- $ref: '#/definitions/object'
- type: object
title: Account
description: An account object.
properties:
links:
$ref: '#/definitions/account_links'
created_on:
type: string
format: date-time
display_name:
type: string
uuid:
type: string
additionalProperties: true
account_links:
type: object
title: Account Links
description: Links related to an Account.
properties:
avatar:
$ref: '#/definitions/link'
additionalProperties: true
securityDefinitions:
basic:
type: 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
description: OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).
flow: accessCode
authorizationUrl: https://bitbucket.org/site/oauth2/authorize
tokenUrl: https://bitbucket.org/site/oauth2/access_token
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
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: 84a5dd73aa83
x-atlassian-narrative:
documents:
- anchor: authentication
title: Authentication methods
description: How to authenticate API actions
icon: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTcuNjQ3MyAxODYuODEzOCI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgaXNvbGF0aW9uOiBpc29sYXRlOwogICAgICB9CgogICAgICAuY2xzLTIgewogICAgICAgIGZpbGw6ICNkZTM1MGI7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogI2ZmNTYzMDsKICAgICAgfQoKICAgICAgLmNscy00IHsKICAgICAgICBmaWxsOiAjZGZlMWU1OwogICAgICAgIG1peC1ibGVuZC1tb2RlOiBtdWx0aXBseTsKICAgICAgfQoKICAgICAgLmNscy01IHsKICAgICAgICBmaWxsOiAjZmFmYmZjOwogICAgICB9CgogICAgICAuY2xzLTYgewogICAgICAgIGZpbGw6ICNlYmVjZjA7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsb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IiZsdDtQYXRoJmd0OyIgY2xhc3M9ImNscy0xMSIgZD0iTTQxLjA0MTYsMTA0LjI1MzlIOTYuODUzMmEzLjk0NDMsMy45NDQzLDAsMCwwLDAtNy44ODg3SDQxLjA0MTZhMy45NDQzLDMuOTQ0MywwLDAsMCwwLDcuODg4N1oiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTEwIiBkPSJNODEuNzk3NSwxMDAuMzFhMy45NDM5LDMuOTQzOSwwLDAsMC0zLjk0NDMtMy45NDQzSDQxLjA0MTdhMy45NDQzLDMuOTQ0MywwLDAsMCwwLDcuODg4N0g3Ny44NTMyQTMuOTQzOSwzLjk0MzksMCwwLDAsODEuNzk3NSwxMDAuMzFaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy0xMCIgZD0iTTIyLjQ5MzIsMTIyLjgwMjlBMjIuNDkyOSwyMi40OTI5LDAsMSwxLDQ0Ljk4NTgsMTAwLjMxLDIyLjUxODUsMjIuNTE4NSwwLDAsMSwyMi40OTMyLDEyMi44MDI5Wm0wLTM3LjA5NzJBMTQuNjA0MiwxNC42MDQyLDAsMSwwLDM3LjA5NzIsMTAwLjMxLDE0LjYyMDcsMTQuNjIwNywwLDAsMCwyMi40OTMyLDg1LjcwNTdaIi8+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=
body: "\nThe purpose of this section is to describe how to authenticate when making API calls using the Bitbucket REST API.\n\n-----\n\n* [Access tokens](#access-tokens)\n * [Repository access tokens](#repository-access-tokens)\n * [Project access tokens](#project-access-tokens)\n * [Workspace access tokens](#workspace-access-tokens)\n* [App passwords](#app-passwords)\n* [API tokens](#api-tokens)\n* [OAuth 2.0](#oauth-2-0)\n * [Making requests](#making-requests)\n * [Repository cloning](#repository-cloning)\n * [Refresh tokens](#refresh-tokens)\n* [Bitbucket OAuth 2.0 Scopes](#bitbucket-oauth-2-0-scopes)\n* [Forge app and API token scopes](#forge-app-and-api-token-scopes)\n\n---\n\n### Access tokens\n\nAccess tokens are passwords (or tokens) that provide access to a _single_ repository, project or workspace.\nThese tokens can authenticate with Bitbucket APIs for scripting, CI/CD tools, Bitbucket Cloud-connected apps,\nand Bitbucket Cloud integrations.\n\nAccess tokens are linked to a repository, project, or workspace, not a user account.\nThe level of access provided by the token is set when a repository, or workspace admin creates it,\nby setting privilege scopes.\n\nThere are three types of access token:\n\n* **Repository access tokens** can connect to a single repository, preventing them from accessing any other repositories or workspaces.\n* **Project access tokens** can connect to a single project, providing access to any repositories within the project.\n* **Workspace access tokens** can connect to a single workspace and have access to any projects and repositories within that workspace.\n\nWhen using Bitbucket APIs with an access token, the token will be treated as the \"user\" in the\nBitbucket UI and Bitbucket logs. This includes when using the access token to leave a comment on a pull request,\npush a commit, or merge a pull request. The Bitbucket UI and API responses will show the\nrepository/project/workspace access token as a user. The username shown in the Bitbucket UI is the Access\nToken _name_, and a custom icon is used to differentiate it from a regular user in the UI.\n\n#### Considerations for using access tokens\n\n* After creation, an access token can't be viewed or modified. The token's name, created date,\nlast accessed date, and scopes are visible on the repository, project, or workspace **access tokens** page.\n* Access tokens can access a limited set of Bitbucket's privilege scopes.\n* Provided you set the correct privilege scopes, you can use an access token to clone (`repository`)\nand push (`repository:write`) code to the token's repository or the repositories the token can access.\n* You can't use an access token to log into the Bitbucket website.\n* Access tokens don't require two-step verification.\n* You can set privilege scopes (specific access rights) for each access token.\n* You can't use an access token to manipulate or query repository, project, or workspace permissions.\n* Access tokens are not listed in any repository or workspace permission API response.\n* Access tokens are deactivated when deleting the resource tied to it (a repository, project, or workspace).\n* Repository access tokens are also revoked when transferring the repository to another workspace.\n* Any content created by the access token will persist after the access token has been revoked.\n* Access tokens can interact with branch restriction APIs, but the token can't be configured as a user with merge access when using branch restrictions.\n\nThere are some APIs which are inaccessible for Access tokens, these are:\n\n* [Add a repository deploy key](/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deploy-keys-post)\n* [Update a repository deploy key](/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deploy-keys-key-id-put)\n* [Delete a repository deploy key](/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deploy-keys-key-id-delete)\n\n#### Repository access tokens\n\nFor details on creating, managing, and using repository access tokens, visit\n[Repository access tokens](https://support.atlassian.com/bitbucket-cloud/docs/repository-access-tokens/).\n\nThe available scopes for repository access tokens are:\n\n- [`repository`](#repository)\n- [`repository:write`](#repository-write)\n- [`repository:admin`](#repository-admin)\n- [`repository:delete`](#repository-delete)\n- [`pullrequest`](#pullrequest)\n- [`pullrequest:write`](#pullrequest-write)\n- [`webhook`](#webhook)\n- [`pipeline`](#pipeline)\n- [`pipeline:write`](#pipeline-write)\n- [`pipeline:variable`](#pipeline-variable)\n- [`runner`](#runner)\n- [`runner:write`](#runner-write)\n\n#### Project access tokens\n\nFor details on creating, managing, and using project access tokens, visit\n[Project access tokens](https://support.atlassian.com/bitbucket-cloud/docs/project-access-tokens/).\n\nThe available scopes for project access tokens are:\n\n- [`project`](#project)\n- [`repository`](#repository)\n- [`repository:write`](#repository-write)\n- [`repository:admin`](#repository-admin)\n- [`repository:delete`](#repository-delete)\n- [`pullrequest`](#pullrequest)\n- [`pullrequest:write`](#pullrequest-write)\n- [`webhook`](#webhook)\n- [`pipeline`](#pipeline)\n- [`pipeline:write`](#pipeline-write)\n- [`pipeline:variable`](#pipeline-variable)\n- [`runner`](#runner)\n- [`runner:write`](#runner-write)\n\n#### Workspace access tokens\n\nFor details on creating, managing, and using workspace access tokens, visit\n[Workspace access tokens](https://support.atlassian.com/bitbucket-cloud/docs/workspace-access-tokens/).\n\nThe available scopes for workspace access tokens are:\n\n- [`project`](#project)\n- [`project:admin`](#project-admin)\n- [`repository`](#repository)\n- [`repository:write`](#repository-write)\n- [`repository:admin`](#repository-admin)\n- [`repository:delete`](#repository-delete)\n- [`pullrequest`](#pullrequest)\n- [`pullrequest:write`](#pullrequest-write)\n- [`webhook`](#webhook)\n- [`account`](#account)\n- [`pipeline`](#pipeline)\n- [`pipeline:write`](#pipeline-write)\n- [`pipeline:variable`](#pipeline-variable)\n- [`runner`](#runner)\n- [`runner:write`](#runner-write)\n\n### App passwords\n\nApp passwords are deprecated. Use [API tokens](#api-tokens).\n\n### API tokens\n\nAPI Tokens are personal access tokens that users can create to authenticate with Bitbucket's REST APIs\nor interact with Git. They are designed as a long term replacement for app passwords, while retaining a\nlot of the functionality you are already familiar with.\n\nSome important points about API tokens:\n\n* To authenticate with an API token, use Basic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617), where\n the username is your Atlassian email and password is the API token.\n* You cannot view an API token or adjust permissions after you create the API token. They are\n designed to be disposable. If you need to change the scopes or you've lost the token, you should just create a new one.\n* API token require an expiry date at creation, with a maximum duration of 1 year.\n* You ca
# --- truncated at 32 KB (127 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bitbucket/refs/heads/main/openapi/bitbucket-gpg-api-openapi.yml