Bitbucket API

Git code hosting and collaboration

developer.atlassian.com/cloud/bitbucket/rest ↗
Version
2.0
OpenAPI
3.0.0
Endpoints
318
Schemas
216
93
Quality
Updated
3 days ago
Developer tools git code-hosting developer-tools
Use this API in your AI agent

Query structured spec data via REST or MCP. Get exactly what your agent needs.

Get API Key

Server URLs

https://api.bitbucket.org/2.0

Endpoints

Clear filters

Addon 2 endpoints

PUT /addon

Updates the application installation for the user.

This endpoint is intended to be used by Bitbucket Connect apps
and only supports JWT authentication – that is how Bitbucket
identifies the particular installation of the app. Developers
with applications registered in the “Develop Apps” section
of Bitbucket need not use this endpoint as updates for those
applications can be sent out via the UI of that section.

Passing an empty body will update the installation using the
existing descriptor URL.

$ curl -X PUT https://api.bitbucket.org/2.0/addon \
  -H "Authorization: JWT <JWT Token>" \
  --header "Content-Type: application/json" \
  --data '{}'

The new descriptor for the installation can be also provided
in the body directly.

$ curl -X PUT https://api.bitbucket.org/2.0/addon \
  -H "Authorization: JWT <JWT Token>" \
  --header "Content-Type: application/json" \
  --data '{"descriptor": $NEW_DESCRIPTOR}'

In both these modes the URL of the descriptor cannot be changed. To
change the descriptor location and upgrade an installation
the request must be made exclusively with a descriptor_url.

$ curl -X PUT https://api.bitbucket.org/2.0/addon \
  -H "Authorization: JWT <JWT Token>" \
  --header "Content-Type: application/json" \
  --data '{"descriptor_url": $NEW_URL}'

The descriptor_url must exactly match the marketplace registration
that Atlassian has for the application. Contact your Atlassian
developer advocate to update this registration. Once the registration
has been updated you may call this resource for each installation.

Note that the scopes of the application cannot be increased
in the new descriptor nor reduced to none.

operationId: Addon_updateAppInstallation

Responses

204

Request has succeeded. The installation has been updated to the new descriptor.

400

Scopes have increased or decreased to none.

401

No authorization.

403

Improper authentication.

PUT /addon
PUT /addon/linkers/{linker_key}/values

Bulk update linker values for the specified
linker of the authenticated application.

A linker value lets applications supply values to modify its regular expression.

The base regular expression must use a Bitbucket-specific match group (?K)
which will be translated to ([\w\-]+). A value must match this pattern.

Read more about linker values

operationId: Addon_updateLinkerValues

Parameters

Name In Required Type Description
linker_key path required string

The unique key of a linker module
as defined in an application descriptor.

Responses

204

Successfully updated the linker values.

400

Invalid input.

401

Authentication must use app JWT

404

The linker does not exist.

PUT /addon/linkers/{linker_key}/values

Branchrestrictions 1 endpoints

PUT /repositories/{workspace}/{repo_slug}/branch-restrictions/{id}

Updates an existing branch restriction rule.

Fields not present in the request body are ignored.

See POST for details.

operationId: BranchRestrictions_updateRule

Parameters

Name In Required Type Description
id path required string

The restriction rule’s id

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

required

The new version of the existing rule

application/json
schema branchrestriction
Property Type Required
type string required
users array optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
groups array optional
type string required
name string optional
slug string optional
links object optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
owner object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
full_slug string optional
workspace object optional
type string required
name string optional
slug string optional
uuid string optional
links object optional
html object optional
self object optional
avatar object optional
owners object optional
members object optional
projects object optional
snippets object optional
repositories object optional
created_on string optional
is_private boolean optional
updated_on string optional

Responses

200

The updated branch restriction rule

401

If the request was not authenticated

403

If the authenticated user does not have admin access to the repository

404

If the repository or branch restriction id does not exist

PUT /repositories/{workspace}/{repo_slug}/branch-restrictions/{id}

Branchingmodel 2 endpoints

PUT /repositories/{workspace}/{repo_slug}/branching-model/settings

Update the branching model configuration for a repository.

The development branch can be configured to a specific branch or to
track the main branch. When set to a specific branch it must
currently exist. Only the passed properties will be updated. The
properties not passed will be left unchanged. A request without a
development property will leave the development branch unchanged.

It is possible for the development branch to be invalid. This
happens when it points at a specific branch that has been
deleted. This is indicated in the is_valid field for the branch. It is
not possible to update the settings for development if that
would leave the branch in an invalid state. Such a request will be
rejected.

The production branch can be a specific branch, the main
branch or disabled. When set to a specific branch it must currently
exist. The enabled property can be used to enable (true) or
disable (false) it. Only the passed properties will be updated. The
properties not passed will be left unchanged. A request without a
production property will leave the production branch unchanged.

It is possible for the production branch to be invalid. This
happens when it points at a specific branch that has been
deleted. This is indicated in the is_valid field for the branch. A
request that would leave production enabled and invalid will be
rejected. It is possible to update production and make it invalid if
it would also be left disabled.

The branch_types property contains the branch types to be updated.
Only the branch types passed will be updated. All updates will be
rejected if it would leave the branching model in an invalid state.
For branch types this means that:

  1. The prefixes for all enabled branch types are valid. For example,
    it is not possible to use ‘*’ inside a Git prefix.
  2. A prefix of an enabled branch type must not be a prefix of another
    enabled branch type. This is to ensure that a branch can be easily
    classified by its prefix unambiguously.

It is possible to store an invalid prefix if that branch type would be
left disabled. Only the passed properties will be updated. The
properties not passed will be left unchanged. Each branch type must
have a kind property to identify it.

There is currently a side effect when using this API endpoint. If the
repository is inheriting branching model settings from its project,
updating the branching model for this repository will disable the
project setting inheritance.

We have deprecated this side effect and will remove it on 1 August 2022.

operationId: BranchingModel_updateConfig

Parameters

Name In Required Type Description
repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The updated branching model configuration

400

If the request contains invalid branching model configuration

401

If the request was not authenticated

403

If the authenticated user does not have admin access to the repository

404

If the repository does not exist

PUT /repositories/{workspace}/{repo_slug}/branching-model/settings
PUT /workspaces/{workspace}/projects/{project_key}/branching-model/settings

Update the branching model configuration for a project.

The development branch can be configured to a specific branch or to
track the main branch. Any branch name can be supplied, but will only
successfully be applied to a repository via inheritance if that branch
exists for that repository. Only the passed properties will be updated. The
properties not passed will be left unchanged. A request without a
development property will leave the development branch unchanged.

The production branch can be a specific branch, the main
branch or disabled. Any branch name can be supplied, but will only
successfully be applied to a repository via inheritance if that branch
exists for that repository. The enabled property can be used to enable (true)
or disable (false) it. Only the passed properties will be updated. The
properties not passed will be left unchanged. A request without a
production property will leave the production branch unchanged.

The branch_types property contains the branch types to be updated.
Only the branch types passed will be updated. All updates will be
rejected if it would leave the branching model in an invalid state.
For branch types this means that:

  1. The prefixes for all enabled branch types are valid. For example,
    it is not possible to use ‘*’ inside a Git prefix.
  2. A prefix of an enabled branch type must not be a prefix of another
    enabled branch type. This is to ensure that a branch can be easily
    classified by its prefix unambiguously.

It is possible to store an invalid prefix if that branch type would be
left disabled. Only the passed properties will be updated. The
properties not passed will be left unchanged. Each branch type must
have a kind property to identify it.

operationId: BranchingModel_updateProjectBranchingModelSettings

Parameters

Name In Required Type Description
project_key path required string

The project in question. This is the actual key assigned
to the project.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The updated branching model configuration

400

If the request contains an invalid branching model configuration

401

If the request was not authenticated

403

If the authenticated user does not have admin access to the project

404

If the project does not exist

PUT /workspaces/{workspace}/projects/{project_key}/branching-model/settings

Commitstatuses 1 endpoints

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}

Used to update the current status of a build status object on the
specific commit.

This operation can also be used to change other properties of the
build status:

  • state
  • name
  • description
  • url
  • refname

The key cannot be changed.

operationId: CommitStatuses_updateBuildStatus

Parameters

Name In Required Type Description
commit path required string

The commit’s SHA1.

key path required string

The build status’ unique key

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

The updated build status object

application/json
schema commitstatus
Property Type Required
type string required
key string optional
url string optional
name string optional
uuid string optional
links object optional
self object optional
href string optional
name string optional
commit object optional
href string optional
name string optional
state string optional
refname string optional
created_on string optional
updated_on string optional
description string optional

Responses

200

The updated build status object.

401

If the repository is private and the request was not authenticated.

404

If the repository or build does not exist

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}

Commits 1 endpoints

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}

Used to update the contents of a comment. Only the content of the comment can be updated.

$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/7f71b5/comments/5728901 \
  -X PUT -u evzijst \
  -H 'Content-Type: application/json' \
  -d '{"content": {"raw": "One more thing!"}'
operationId: Commits_updateComment

Parameters

Name In Required Type Description
comment_id path required integer

The id of the comment.

commit path required string

The commit’s SHA1.

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

required

The updated comment.

application/json
schema commit_comment
Property Type Required
type string required
id integer optional
user object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
links object optional
code object optional
href string optional
name string optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
inline object optional
to integer optional
from integer optional
path string required
parent object optional
content object optional
raw string optional
html string optional
markup string optional
deleted boolean optional
created_on string optional
updated_on string optional
commit object optional
type string required
date string optional
hash string optional
author object optional
type string required
raw string optional
user object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
message string optional
parents array optional
summary object optional
raw string optional
html string optional
markup string optional
repository object optional
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
html object optional
self object optional
clone array optional
forks object optional
hooks object optional
avatar object optional
commits object optional
watchers object optional
downloads object optional
pullrequests object optional
owner object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
parent object optional
project object optional
type string required
key string optional
name string optional
uuid string optional
links object optional
owner object optional
created_on string optional
is_private boolean optional
updated_on string optional
description string optional
has_publicly_visible_repos boolean optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
name string optional
type string required
links object optional
target object optional
merge_strategies array optional
default_merge_strategy string optional
updated_on string optional
description string optional
fork_policy string optional
participants array optional
type string required
role string optional
user object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
state string optional
approved boolean optional
participated_on string optional

Responses

201

The newly updated comment.

400

If the comment update was detected as spam

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}

Deployments 1 endpoints

PUT /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}

Create a new deploy key in a repository.

The same key needs to be passed in but the comment and label can change.

Example:

$ curl -X PUT \
-H "Authorization <auth header>" \
-H "Content-type: application/json" \
https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234 -d \
'{
    "label": "newlabel",
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 newcomment",
}'
operationId: Deployments_updateRepositoryDeployKey

Parameters

Name In Required Type Description
key_id path required string

The key ID matching the deploy key.

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The newly updated deploy key.

400

If the submitted key or related value is invalid

403

If the current user does not have permission to add a key for the specified user

404

If the specified user, repository, or deploy key does not exist

PUT /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}

Issuetracker 4 endpoints

PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}

Modifies the issue.

$ curl https://api.bitbucket.org/2.0/repostories/evzijst/dogslow/issues/123 \
  -u evzijst -s -X PUT -H 'Content-Type: application/json' \
  -d '{
  "title": "Updated title",
  "assignee": {
    "account_id": "5d5355e8c6b9320d9ea5b28d"
  },
  "priority": "minor",
  "version": {
    "name": "1.0"
  },
  "component": null
}'

This example changes the title, assignee, priority and the
version. It also removes the value of the component from the issue
by setting the field to null. Any field not present keeps its existing
value.

Each time an issue is edited in the UI or through the API, an immutable
change record is created under the /issues/123/changes endpoint. It
also has a comment associated with the change.

operationId: IssueTracker_updateIssue

Parameters

Name In Required Type Description
issue_id path required string

The issue id

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The updated issue object.

403

When the authenticated user isn’t authorized to access the issue.

404

The specified repository or issue does not exist or does not have the issue tracker enabled.

PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}
PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}

Updates the content of the specified issue comment. Note that only
the content.raw field can be modified.

$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/5728901 \
  -X PUT -u evzijst \
  -H 'Content-Type: application/json' \
  -d '{"content": {"raw": "Lorem ipsum."}'
operationId: IssueTracker_updateIssueCommentContent

Parameters

Name In Required Type Description
comment_id path required integer

The id of the comment.

issue_id path required string

The issue id

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

required

The updated comment.

application/json
schema issue_comment
Property Type Required
type string required
id integer optional
user object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
links object optional
code object optional
href string optional
name string optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
inline object optional
to integer optional
from integer optional
path string required
parent object optional
content object optional
raw string optional
html string optional
markup string optional
deleted boolean optional
created_on string optional
updated_on string optional
issue object optional
type string required
id integer optional
kind string optional
links object optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
vote object optional
href string optional
name string optional
watch object optional
href string optional
name string optional
comments object optional
href string optional
name string optional
attachments object optional
href string optional
name string optional
state string optional
title string optional
votes integer optional
content object optional
raw string optional
html string optional
markup string optional
version object optional
type string required
id integer optional
name string optional
links object optional
self object optional
assignee object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
priority string optional
reporter object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
component object optional
type string required
id integer optional
name string optional
links object optional
self object optional
edited_on string optional
milestone object optional
type string required
id integer optional
name string optional
links object optional
self object optional
created_on string optional
repository object optional
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
html object optional
self object optional
clone array optional
forks object optional
hooks object optional
avatar object optional
commits object optional
watchers object optional
downloads object optional
pullrequests object optional
owner object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
parent object optional
project object optional
type string required
key string optional
name string optional
uuid string optional
links object optional
owner object optional
created_on string optional
is_private boolean optional
updated_on string optional
description string optional
has_publicly_visible_repos boolean optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
name string optional
type string required
links object optional
target object optional
merge_strategies array optional
default_merge_strategy string optional
updated_on string optional
description string optional
fork_policy string optional
updated_on string optional

Responses

200

The updated issue comment.

400

If the input was invalid, or if the update to the comment is detected as spam

PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote

Vote for this issue.

To cast your vote, do an empty PUT. The 204 status code indicates that
the operation was successful.

operationId: IssueTracker_voteForIssue

Parameters

Name In Required Type Description
issue_id path required string

The issue id

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

204

Indicating the authenticated user has cast their vote successfully.

401

When the request wasn’t authenticated.

404

The specified repository or issue does not exist or does not have the issue tracker enabled.

PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch

Start watching this issue.

To start watching this issue, do an empty PUT. The 204 status code
indicates that the operation was successful.

operationId: IssueTracker_watchIssue

Parameters

Name In Required Type Description
issue_id path required string

The issue id

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

204

Indicates that the authenticated user successfully started watching this issue.

401

When the request wasn’t authenticated.

404

If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.

PUT /repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch

Pipelines 8 endpoints

PUT /repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}

Update a deployment environment level variable.

operationId: Pipelines_updateEnvironmentVariable

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

environment_uuid path required string

The environment.

variable_uuid path required string

The UUID of the variable to update.

Request Body

required

The updated deployment variable.

application/json
schema deployment_variable
Property Type Required
type string required
key string optional
uuid string optional
value string optional
secured boolean optional

Responses

200

The deployment variable was updated.

404

The account, repository, environment or variable with the given UUID was not found.

PUT /repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}
PUT /repositories/{workspace}/{repo_slug}/pipelines_config

Update the pipelines configuration for a repository.

operationId: Pipelines_updateConfiguration

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

Request Body

required

The updated repository pipelines configuration.

application/json
schema pipelines_config
Property Type Required
type string required
enabled boolean optional
repository object optional
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
clone array optional
href string optional
name string optional
forks object optional
href string optional
name string optional
hooks object optional
href string optional
name string optional
avatar object optional
href string optional
name string optional
commits object optional
href string optional
name string optional
watchers object optional
href string optional
name string optional
downloads object optional
href string optional
name string optional
pullrequests object optional
href string optional
name string optional
owner object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
parent object optional
project object optional
type string required
key string optional
name string optional
uuid string optional
links object optional
html object optional
avatar object optional
owner object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
created_on string optional
is_private boolean optional
updated_on string optional
description string optional
has_publicly_visible_repos boolean optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
name string optional
type string required
links object optional
html object optional
self object optional
commits object optional
target object optional
type string required
date string optional
hash string optional
author object optional
message string optional
parents array optional
summary object optional
repository object optional
participants array optional
merge_strategies array optional
default_merge_strategy string optional
updated_on string optional
description string optional
fork_policy string optional

Responses

200

The repository pipelines configuration was updated.

PUT /repositories/{workspace}/{repo_slug}/pipelines_config
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/build_number

Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository.

operationId: Pipelines_updateNextBuildNumber

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

Request Body

required

The build number to update.

application/json
schema pipeline_build_number
Property Type Required
type string required
next integer optional

Responses

200

The build number has been configured.

400

The update failed because the next number was invalid (it should be higher than the current number).

404

The account or repository was not found.

PUT /repositories/{workspace}/{repo_slug}/pipelines_config/build_number
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}

Update a schedule.

operationId: Pipelines_updateSchedule

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

schedule_uuid path required string

The uuid of the schedule.

Request Body

required

The schedule to update.

application/json
schema pipeline_schedule_put_request_body
Property Type Required
type string required
enabled boolean optional

Responses

200

The schedule is updated.

404

The account, repository or schedule was not found.

PUT /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair

Create or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container.

operationId: Pipelines_updateSshKeyPair

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

Request Body

required

The created or updated SSH key pair.

application/json
schema pipeline_ssh_key_pair
Property Type Required
type string required
public_key string optional
private_key string optional

Responses

200

The SSH key pair was created or updated.

404

The account, repository or SSH key pair was not found.

PUT /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}

Update a repository level known host.

operationId: Pipelines_updateKnownHost

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

known_host_uuid path required string

The UUID of the known host to update.

Request Body

required

The updated known host.

application/json
schema pipeline_known_host
Property Type Required
type string required
uuid string optional
hostname string optional
public_key object optional
type string required
key string optional
key_type string optional
md5_fingerprint string optional
sha256_fingerprint string optional

Responses

200

The known host was updated.

404

The account, repository or known host with the given UUID was not found.

PUT /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}

Update a repository level variable.

operationId: Pipelines_updateVariableForRepository

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

variable_uuid path required string

The UUID of the variable to update.

Request Body

required

The updated variable

application/json
schema pipeline_variable
Property Type Required
type string required
key string optional
uuid string optional
value string optional
secured boolean optional

Responses

200

The variable was updated.

404

The account, repository or variable with the given UUID was not found.

PUT /repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
PUT /workspaces/{workspace}/pipelines-config/variables/{variable_uuid}

Update a workspace level variable.

operationId: Pipelines_updateVariableWorkspace

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

variable_uuid path required string

The UUID of the variable.

Request Body

The updated variable.

application/json
schema pipeline_variable
Property Type Required
type string required
key string optional
uuid string optional
value string optional
secured boolean optional

Responses

200

The variable was updated.

404

The workspace or the variable was not found.

PUT /workspaces/{workspace}/pipelines-config/variables/{variable_uuid}

Projects 4 endpoints

PUT /workspaces/{workspace}/projects/{project_key}

Since this endpoint can be used to both update and to create a
project, the request body depends on the intent.

Creation

See the POST documentation for the project collection for an
example of the request body.

Note: The key should not be specified in the body of request
(since it is already present in the URL). The name is required,
everything else is optional.

Update

See the POST documentation for the project collection for an
example of the request body.

Note: The key is not required in the body (since it is already in
the URL). The key may be specified in the body, if the intent is
to change the key itself. In such a scenario, the location of the
project is changed and is returned in the Location header of the
response.

operationId: Projects_updateProjectInWorkspace

Parameters

Name In Required Type Description
project_key path required string

The project in question. This is the actual key assigned
to the project.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

application/json
schema project
Property Type Required
type string required
key string optional
name string optional
uuid string optional
links object optional
html object optional
href string optional
name string optional
avatar object optional
href string optional
name string optional
owner object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
members object optional
href string optional
name string optional
projects object optional
href string optional
name string optional
repositories object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
created_on string optional
is_private boolean optional
updated_on string optional
description string optional
has_publicly_visible_repos boolean optional

Responses

200

The existing project is has been updated.

201

A new project has been created.

403

The requesting user isn’t authorized to update or create the project.

404

A workspace doesn’t exist at the location. Note that the project’s absence from this location doesn’t raise a 404, since a PUT at a non-existent location can be used to create a new project.

PUT /workspaces/{workspace}/projects/{project_key}
PUT /workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}

Adds the specified user to the project’s list of default reviewers. The method is
idempotent. Accepts an optional body containing the uuid of the user to be added.

operationId: Projects_addDefaultReviewer

Parameters

Name In Required Type Description
project_key path required string

The project in question. This can either be the actual key assigned
to the project or the UUID (surrounded by curly-braces ({})).

selected_user path required string

This can either be the username or the UUID of the default reviewer,
surrounded by curly-braces, for example: {account UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The specified user was added as a project default reviewer

400

If the specified user cannot be added as a default reviewer for the project

403

If the authenticated user does not have admin access to the project

404

If the specified user, project, or workspace does not exist

PUT /workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
PUT /workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}

Updates the group permission, or grants a new permission if one does not already exist.

Only users with admin permission for the project may access this resource.

Due to security concerns, the JWT and OAuth authentication methods are unsupported.
This is to ensure integrations and add-ons are not allowed to change permissions.

Permissions can be:

  • admin
  • create-repo
  • write
  • read
operationId: Projects_updateGroupPermission

Parameters

Name In Required Type Description
group_slug path required string

Slug of the requested group.

project_key path required string

The project in question. This is the actual key assigned to the project.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

The permission to grant

application/json
schema bitbucket.apps.permissions.serializers.ProjectPermissionUpdateSchema
Property Type Required
permission string required

Responses

200

Project group permission updated.

400

No permission value was provided or the value is invalid(not one of read, write, create-repo, or admin).

401

The user couldn’t be authenticated.

402

You have reached your plan’s user limit and must upgrade before giving access to additional users.

403

The requesting user isn’t an admin of the project, or the authentication method was not via app password.

404

One or more of the workspace, project, and group doesn’t exist for the given identifiers or the requesting user is not authenticated

PUT /workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
PUT /workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}

Updates the explicit user permission for a given user and project. The selected
user must be a member of the workspace, and cannot be the workspace owner.

Only users with admin permission for the project may access this resource.

Due to security concerns, the JWT and OAuth authentication methods are unsupported.
This is to ensure integrations and add-ons are not allowed to change permissions.

Permissions can be:

  • admin
  • create-repo
  • write
  • read
operationId: Projects_updateUserPermission

Parameters

Name In Required Type Description
project_key path required string

The project in question. This is the actual key assigned to the project.

selected_user_id path required string

This can either be the username, the user’s UUID surrounded by curly-braces,
for example: {account UUID}, or the user’s Atlassian ID.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

The permission to grant

application/json
schema bitbucket.apps.permissions.serializers.ProjectPermissionUpdateSchema
Property Type Required
permission string required

Responses

200

Explicit user permission updated

400

No permission value was provided or the value is invalid (not one of read, write, create-repo, or admin)

401

The user couldn’t be authenticated.

402

You have reached your plan’s user limit and must upgrade before giving access to additional users.

403

The requesting user isn’t an admin of the project, or the authentication method was not via app password.

404

One or more of the workspace, project, and selected user doesn’t exist for the given identifiers or the requesting user is not authenticated

PUT /workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}

Properties 4 endpoints

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}

Update an application property value stored against a commit.

operationId: Properties_updateCommitApplicationProperty

Parameters

Name In Required Type Description
workspace path required string

The repository container; either the workspace slug or the UUID in curly braces.

repo_slug path required string

The repository.

commit path required string

The commit.

app_key path required string

The key of the Connect app.

property_name path required string

The name of the property.

Request Body

The application property to create or update.

application/json
schema application_property
Property Type Required
_attributes array optional

Responses

204

An empty response.

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
PUT /repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}

Update an application property value stored against a repository.

operationId: Properties_updateApplicationProperty

Parameters

Name In Required Type Description
workspace path required string

The repository container; either the workspace slug or the UUID in curly braces.

repo_slug path required string

The repository.

app_key path required string

The key of the Connect app.

property_name path required string

The name of the property.

Request Body

The application property to create or update.

application/json
schema application_property
Property Type Required
_attributes array optional

Responses

204

An empty response.

PUT /repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}

Update an application property value stored against a pull request.

operationId: Properties_updatePullRequestApplicationProperty

Parameters

Name In Required Type Description
workspace path required string

The repository container; either the workspace slug or the UUID in curly braces.

repo_slug path required string

The repository.

pullrequest_id path required string

The pull request ID.

app_key path required string

The key of the Connect app.

property_name path required string

The name of the property.

Request Body

The application property to create or update.

application/json
schema application_property
Property Type Required
_attributes array optional

Responses

204

An empty response.

PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
PUT /users/{selected_user}/properties/{app_key}/{property_name}

Update an application property value stored against a user.

operationId: Properties_updateUserAppPropertyValue

Parameters

Name In Required Type Description
selected_user path required string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

app_key path required string

The key of the Connect app.

property_name path required string

The name of the property.

Request Body

The application property to create or update.

application/json
schema application_property
Property Type Required
_attributes array optional

Responses

204

An empty response.

PUT /users/{selected_user}/properties/{app_key}/{property_name}

Pullrequests 4 endpoints

PUT /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}

Adds the specified user to the repository’s list of default
reviewers.

This method is idempotent. Adding a user a second time has no effect.

operationId: Pullrequests_addUserToDefaultReviewers

Parameters

Name In Required Type Description
repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

target_username path required string

This can either be the username or the UUID of the default reviewer,
surrounded by curly-braces, for example: {account UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The specified user was successfully added to the default reviewers

400

If the authenticated user tried to add a team, bot user, or user without access to the repository to the default reviewers

403

If the authenticated user does not have permission to modify the default reviewers

404

If the specified user does not exist

PUT /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}

Mutates the specified pull request.

This can be used to change the pull request’s branches or description.

Only open pull requests can be mutated.

operationId: Pullrequests_updatePullRequest

Parameters

Name In Required Type Description
pull_request_id path required integer

The id of the pull request.

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

The pull request that is to be updated.

application/json
schema pullrequest
Property Type Required
type string required
id integer optional
links object optional
diff object optional
href string optional
name string optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
merge object optional
href string optional
name string optional
approve object optional
href string optional
name string optional
commits object optional
href string optional
name string optional
decline object optional
href string optional
name string optional
activity object optional
href string optional
name string optional
comments object optional
href string optional
name string optional
diffstat object optional
href string optional
name string optional
state string optional
title string optional
author object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
reason string optional
source object optional
branch object optional
name string optional
merge_strategies array optional
default_merge_strategy string optional
commit object optional
hash string optional
repository object optional
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
html object optional
self object optional
clone array optional
forks object optional
hooks object optional
avatar object optional
commits object optional
watchers object optional
downloads object optional
pullrequests object optional
owner object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
parent object optional
project object optional
type string required
key string optional
name string optional
uuid string optional
links object optional
owner object optional
created_on string optional
is_private boolean optional
updated_on string optional
description string optional
has_publicly_visible_repos boolean optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
name string optional
type string required
links object optional
target object optional
merge_strategies array optional
default_merge_strategy string optional
updated_on string optional
description string optional
fork_policy string optional
summary object optional
raw string optional
html string optional
markup string optional
rendered object optional
title object optional
raw string optional
html string optional
markup string optional
reason object optional
raw string optional
html string optional
markup string optional
description object optional
raw string optional
html string optional
markup string optional
closed_by object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
reviewers array optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
created_on string optional
task_count integer optional
updated_on string optional
destination object optional
branch object optional
name string optional
merge_strategies array optional
default_merge_strategy string optional
commit object optional
hash string optional
repository object optional
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
html object optional
self object optional
clone array optional
forks object optional
hooks object optional
avatar object optional
commits object optional
watchers object optional
downloads object optional
pullrequests object optional
owner object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
parent object optional
project object optional
type string required
key string optional
name string optional
uuid string optional
links object optional
owner object optional
created_on string optional
is_private boolean optional
updated_on string optional
description string optional
has_publicly_visible_repos boolean optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
name string optional
type string required
links object optional
target object optional
merge_strategies array optional
default_merge_strategy string optional
updated_on string optional
description string optional
fork_policy string optional
merge_commit object optional
hash string optional
participants array optional
type string required
role string optional
user object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
state string optional
approved boolean optional
participated_on string optional
comment_count integer optional
close_source_branch boolean optional

Responses

200

The updated pull request

400

If the input document was invalid.

401

If the request was not authenticated.

404

If the repository or pull request id does not exist

PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}

Updates a specific pull request comment.

operationId: Pullrequests_updateComment

Parameters

Name In Required Type Description
comment_id path required integer

The id of the comment.

pull_request_id path required integer

The id of the pull request.

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

required

The contents of the updated comment.

application/json
schema pullrequest_comment
Property Type Required
type string required
id integer optional
user object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
links object optional
code object optional
href string optional
name string optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
inline object optional
to integer optional
from integer optional
path string required
parent object optional
content object optional
raw string optional
html string optional
markup string optional
deleted boolean optional
created_on string optional
updated_on string optional
pending boolean optional
resolution object optional
type string required
user object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
created_on string optional
pullrequest object optional
type string required
id integer optional
links object optional
diff object optional
href string optional
name string optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
merge object optional
href string optional
name string optional
approve object optional
href string optional
name string optional
commits object optional
href string optional
name string optional
decline object optional
href string optional
name string optional
activity object optional
href string optional
name string optional
comments object optional
href string optional
name string optional
diffstat object optional
href string optional
name string optional
state string optional
title string optional
author object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
reason string optional
source object optional
branch object optional
name string optional
merge_strategies array optional
default_merge_strategy string optional
commit object optional
hash string optional
repository object optional
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
owner object optional
parent object optional
project object optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
updated_on string optional
description string optional
fork_policy string optional
summary object optional
raw string optional
html string optional
markup string optional
rendered object optional
title object optional
raw string optional
html string optional
markup string optional
reason object optional
raw string optional
html string optional
markup string optional
description object optional
raw string optional
html string optional
markup string optional
closed_by object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
reviewers array optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
created_on string optional
task_count integer optional
updated_on string optional
destination object optional
branch object optional
name string optional
merge_strategies array optional
default_merge_strategy string optional
commit object optional
hash string optional
repository object optional
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
owner object optional
parent object optional
project object optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
updated_on string optional
description string optional
fork_policy string optional
merge_commit object optional
hash string optional
participants array optional
type string required
role string optional
user object optional
type string required
uuid string optional
links object optional
username string optional
created_on string optional
display_name string optional
state string optional
approved boolean optional
participated_on string optional
comment_count integer optional
close_source_branch boolean optional

Responses

200

The updated comment.

403

If the authenticated user does not have access to the comment.

404

If the comment does not exist.

PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}

Updates a specific pull request task.

operationId: Pullrequests_updateTask

Parameters

Name In Required Type Description
pull_request_id path required integer

The id of the pull request.

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

task_id path required integer

The ID of the task.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

required

The updated state and content of the task.

application/json
schema A_pullrequest_task_update
Property Type Required
state string optional
content object optional
raw string required

Responses

200

The updated task.

400

There is a missing required field in the request or the task content is blank.

403

If the authenticated user does not have access to the pull request.

404

If the task does not exist.

PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}

Reports 2 endpoints

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}

Creates or updates a report for the specified commit.
To upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system’s name to avoid collisions, for example, mySystem-001.

Sample cURL request:

curl --request PUT 'https://api.bitbucket.org/2.0/repositories/<username>/<reposity-name>/commit/<commit-hash>/reports/mysystem-001' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title": "Security scan report",
    "details": "This pull request introduces 10 new dependency vulnerabilities.",
    "report_type": "SECURITY",
    "reporter": "mySystem",
    "link": "http://www.mysystem.com/reports/001",
    "result": "FAILED",
    "data": [
        {
            "title": "Duration (seconds)",
            "type": "DURATION",
            "value": 14
        },
        {
            "title": "Safe to merge?",
            "type": "BOOLEAN",
            "value": false
        }
    ]
}'

Possible field values:

report_type: SECURITY, COVERAGE, TEST, BUG
result: PASSED, FAILED, PENDING
data.type: BOOLEAN, DATE, DURATION, LINK, NUMBER, PERCENTAGE, TEXT

Data field formats

| Type Field | Value Field Type | Value Field Display |
|:————–|:——————|:——————–|
| None/ Omitted | Number, String or Boolean (not an array or object) | Plain text |
| BOOLEAN | Boolean | The value will be read as a JSON boolean and displayed as ‘Yes’ or ‘No’. |
| DATE | Number | The value will be read as a JSON number in the form of a Unix timestamp (milliseconds) and will be displayed as a relative date if the date is less than one week ago, otherwise it will be displayed as an absolute date. |
| DURATION | Number | The value will be read as a JSON number in milliseconds and will be displayed in a human readable duration format. |
| LINK | Object: {"text": "Link text here", "href": "https://link.to.annotation/in/external/tool"} | The value will be read as a JSON object containing the fields “text” and “href” and will be displayed as a clickable link on the report. |
| NUMBER | Number | The value will be read as a JSON number and large numbers will be displayed in a human readable format (e.g. 14.3k). |
| PERCENTAGE | Number (between 0 and 100) | The value will be read as a JSON number between 0 and 100 and will be displayed with a percentage sign. |
| TEXT | String | The value will be read as a JSON string and will be displayed as-is |

Please refer to the Code Insights documentation for more information.

operationId: Reports_commitReportCreateOrUpdate

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

commit path required string

The commit the report belongs to.

reportId path required string

Either the uuid or external-id of the report.

Request Body

required

The report to create or update

application/json
schema report
Property Type Required
type string required
data array optional
type string optional
title string optional
value object optional
link string optional
uuid string optional
title string optional
result string optional
details string optional
logo_url string optional
reporter string optional
created_on string optional
updated_on string optional
external_id string optional
report_type string optional
remote_link_enabled boolean optional

Responses

200

OK

400

The provided Report object is malformed or incomplete.

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}

Creates or updates an individual annotation for the specified report.
Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.

Just as reports, annotation needs to be uploaded with a unique ID that can later be used to identify the report as an alternative to the generated UUID. If you want to use an existing id from your own system, we recommend prefixing it with your system’s name to avoid collisions, for example, mySystem-annotation001.

Sample cURL request:

curl --request PUT 'https://api.bitbucket.org/2.0/repositories/<username>/<reposity-name>/commit/<commit-hash>/reports/mySystem-001/annotations/mysystem-annotation001' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title": "Security scan report",
    "annotation_type": "VULNERABILITY",
    "summary": "This line represents a security thread.",
    "severity": "HIGH",
    "path": "my-service/src/main/java/com/myCompany/mysystem/logic/Main.java",
    "line": 42
}'

Possible field values:

annotation_type: VULNERABILITY, CODE_SMELL, BUG
result: PASSED, FAILED, IGNORED, SKIPPED
severity: HIGH, MEDIUM, LOW, CRITICAL

Please refer to the Code Insights documentation for more information.

operationId: Reports_commitAnnotations

Parameters

Name In Required Type Description
workspace path required string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug path required string

The repository.

commit path required string

The commit the report belongs to.

reportId path required string

Either the uuid or external-id of the report.

annotationId path required string

Either the uuid or external-id of the annotation.

Request Body

required

The annotation to create or update

application/json
schema report_annotation
Property Type Required
type string required
line integer optional
link string optional
path string optional
uuid string optional
result string optional
details string optional
summary string optional
severity string optional
created_on string optional
updated_on string optional
external_id string optional
annotation_type string optional

Responses

200

OK

400

The provided Annotation object is malformed or incomplete.

PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}

Repositories 5 endpoints

PUT /repositories/{workspace}/{repo_slug}

Since this endpoint can be used to both update and to create a
repository, the request body depends on the intent.

Creation

See the POST documentation for the repository endpoint for an example
of the request body.

Update

Note: Changing the name of the repository will cause the location to
be changed. This is because the URL of the repo is derived from the
name (a process called slugification). In such a scenario, it is
possible for the request to fail if the newly created slug conflicts
with an existing repository’s slug. But if there is no conflict,
the new location will be returned in the Location header of the
response.

operationId: Repositories_createOrUpdate

Parameters

Name In Required Type Description
repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

The repository that is to be updated.

Note that the elements “owner” and “full_name” are ignored since the
URL implies them.

application/json
schema repository
Property Type Required
type string required
scm string optional
name string optional
size integer optional
uuid string optional
links object optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
clone array optional
href string optional
name string optional
forks object optional
href string optional
name string optional
hooks object optional
href string optional
name string optional
avatar object optional
href string optional
name string optional
commits object optional
href string optional
name string optional
watchers object optional
href string optional
name string optional
downloads object optional
href string optional
name string optional
pullrequests object optional
href string optional
name string optional
owner object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional
parent object optional
project object optional
type string required
key string optional
name string optional
uuid string optional
links object optional
html object optional
href string optional
name string optional
avatar object optional
href string optional
name string optional
owner object optional
type string required
uuid string optional
links object optional
avatar object optional
html object optional
self object optional
members object optional
projects object optional
repositories object optional
username string optional
created_on string optional
display_name string optional
created_on string optional
is_private boolean optional
updated_on string optional
description string optional
has_publicly_visible_repos boolean optional
has_wiki boolean optional
language string optional
full_name string optional
created_on string optional
has_issues boolean optional
is_private boolean optional
mainbranch object optional
name string optional
type string required
links object optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
commits object optional
href string optional
name string optional
target object optional
type string required
date string optional
hash string optional
author object optional
type string required
raw string optional
user object optional
message string optional
parents array optional
summary object optional
raw string optional
html string optional
markup string optional
repository object optional
participants array optional
type string required
role string optional
user object optional
state string optional
approved boolean optional
participated_on string optional
merge_strategies array optional
default_merge_strategy string optional
updated_on string optional
description string optional
fork_policy string optional

Responses

200

The existing repository has been updated

201

A new repository has been created

400

If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.

401

If the request was not authenticated.

PUT /repositories/{workspace}/{repo_slug}
PUT /repositories/{workspace}/{repo_slug}/override-settings
operationId: Repositories_setInheritanceState

Parameters

Name In Required Type Description
repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

204

The repository setting inheritance state was set and no content returned

404

If no repository exists at this location

PUT /repositories/{workspace}/{repo_slug}/override-settings
PUT /repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}

Updates the group permission, or grants a new permission if one does not already exist.

Only users with admin permission for the repository may access this resource.

The only authentication method supported for this endpoint is via app passwords.

Permissions can be:

  • admin
  • write
  • read
operationId: Repositories_updateGroupPermission

Parameters

Name In Required Type Description
group_slug path required string

Slug of the requested group.

repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

The permission to grant

application/json
schema bitbucket.apps.permissions.serializers.RepoPermissionUpdateSchema
Property Type Required
permission string required

Responses

200

Group permission updated

400

No permission value was provided or the value is invalid(not one of read, write, or admin)

401

The user couldn’t be authenticated.

402

You have reached your plan’s user limit and must upgrade before giving access to additional users.

403

The requesting user isn’t an admin of the repository, or the authentication method was not via app password.

404

The workspace does not exist, the repository does not exist, or the group does not exist.

PUT /repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
PUT /repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}

Updates the explicit user permission for a given user and repository. The selected user must be a member of
the workspace, and cannot be the workspace owner.
Only users with admin permission for the repository may access this resource.

The only authentication method for this endpoint is via app passwords.

Permissions can be:

  • admin
  • write
  • read
operationId: Repositories_updateUserPermission

Parameters

Name In Required Type Description
repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

selected_user_id path required string

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

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

The permission to grant

application/json
schema bitbucket.apps.permissions.serializers.RepoPermissionUpdateSchema
Property Type Required
permission string required

Responses

200

Explicit user permission updated

400

No permission value was provided or the value is invalid (not one of read, write, or admin), or the selected user is not a valid user to update.

401

The user couldn’t be authenticated.

402

You have reached your plan’s user limit and must upgrade before giving access to additional users.

403

The requesting user isn’t an admin of the repository, or the authentication method was not via app password.

404

One or more of the workspace, repository, and selected user doesn’t exist for the given identifiers.

PUT /repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
PUT /repositories/{workspace}/{repo_slug}/hooks/{uid}

Updates the specified webhook subscription.

The following properties can be mutated:

  • description
  • url
  • secret
  • active
  • events

The hook’s secret is used as a key to generate the HMAC hex digest sent in the
X-Hub-Signature header at delivery time. This signature is only generated
when the hook has a secret.

Set the hook’s secret by passing the new value in the secret field. Passing a
null value in the secret field will remove the secret from the hook. The
hook’s secret can be left unchanged by not passing the secret field in the
request.

operationId: Repositories_updateWebhookSubscription

Parameters

Name In Required Type Description
repo_slug path required string

This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.

uid path required string

Installed webhook’s ID

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The webhook subscription object.

403

If the authenticated user does not have permission to update the webhook.

404

If the webhook or repository does not exist.

PUT /repositories/{workspace}/{repo_slug}/hooks/{uid}

Snippets 4 endpoints

PUT /snippets/{workspace}/{encoded_id}

Used to update a snippet. Use this to add and delete files and to
change a snippet’s title.

To update a snippet, one can either PUT a full snapshot, or only the
parts that need to be changed.

The contract for PUT on this API is that properties missing from the
request remain untouched so that snippets can be efficiently
manipulated with differential payloads.

To delete a property (e.g. the title, or a file), include its name in
the request, but omit its value (use null).

As in Git, explicit renaming of files is not supported. Instead, to
rename a file, delete it and add it again under another name. This can
be done atomically in a single request. Rename detection is left to
the SCM.

PUT supports three different content types for both request and
response bodies:

  • application/json
  • multipart/related
  • multipart/form-data

The content type used for the request body can be different than that
used for the response. Content types are specified using standard HTTP
headers.

Use the Content-Type and Accept headers to select the desired
request and response format.

application/json

As with creation and retrieval, the content type determines what
properties can be manipulated. application/json does not support
file contents and is therefore limited to a snippet’s meta data.

To update the title, without changing any of its files:

$ curl -X POST -H "Content-Type: application/json" https://api.bitbucket.org/2.0/snippets/evzijst/kypj             -d '{"title": "Updated title"}'

To delete the title:

$ curl -X POST -H "Content-Type: application/json" https://api.bitbucket.org/2.0/snippets/evzijst/kypj             -d '{"title": null}'

Not all parts of a snippet can be manipulated. The owner and creator
for instance are immutable.

multipart/related

multipart/related can be used to manipulate all of a snippet’s
properties. The body is identical to a POST. properties omitted from
the request are left unchanged. Since the start part contains JSON,
the mechanism for manipulating the snippet’s meta data is identical
to application/json requests.

To update one of a snippet’s file contents, while also changing its
title:

PUT /2.0/snippets/evzijst/kypj HTTP/1.1
Content-Length: 288
Content-Type: multipart/related; start="snippet"; boundary="===============1438169132528273974=="
MIME-Version: 1.0

--===============1438169132528273974==
Content-Type: application/json; charset="utf-8"
MIME-Version: 1.0
Content-ID: snippet

{
  "title": "My updated snippet",
  "files": {
      "foo.txt": {}
    }
}

--===============1438169132528273974==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-ID: "foo.txt"
Content-Disposition: attachment; filename="foo.txt"

Updated file contents.

--===============1438169132528273974==--

Here only the parts that are changed are included in the body. The
other files remain untouched.

Note the use of the files list in the JSON part. This list contains
the files that are being manipulated. This list should have
corresponding multiparts in the request that contain the new contents
of these files.

If a filename in the files list does not have a corresponding part,
it will be deleted from the snippet, as shown below:

PUT /2.0/snippets/evzijst/kypj HTTP/1.1
Content-Length: 188
Content-Type: multipart/related; start="snippet"; boundary="===============1438169132528273974=="
MIME-Version: 1.0

--===============1438169132528273974==
Content-Type: application/json; charset="utf-8"
MIME-Version: 1.0
Content-ID: snippet

{
  "files": {
    "image.png": {}
  }
}

--===============1438169132528273974==--

To simulate a rename, delete a file and add the same file under
another name:

PUT /2.0/snippets/evzijst/kypj HTTP/1.1
Content-Length: 212
Content-Type: multipart/related; start="snippet"; boundary="===============1438169132528273974=="
MIME-Version: 1.0

--===============1438169132528273974==
Content-Type: application/json; charset="utf-8"
MIME-Version: 1.0
Content-ID: snippet

{
    "files": {
      "foo.txt": {},
      "bar.txt": {}
    }
}

--===============1438169132528273974==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-ID: "bar.txt"
Content-Disposition: attachment; filename="bar.txt"

foo

--===============1438169132528273974==--

multipart/form-data

Again, one can also use multipart/form-data to manipulate file
contents and meta data atomically.

$ curl -X PUT http://localhost:12345/2.0/snippets/evzijst/kypj             -F title="My updated snippet" -F file=@foo.txt

PUT /2.0/snippets/evzijst/kypj HTTP/1.1
Content-Length: 351
Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f

------------------------------63a4b224c59f
Content-Disposition: form-data; name="file"; filename="foo.txt"
Content-Type: text/plain

foo

------------------------------63a4b224c59f
Content-Disposition: form-data; name="title"

My updated snippet
------------------------------63a4b224c59f

To delete a file, omit its contents while including its name in the
files field:

$ curl -X PUT https://api.bitbucket.org/2.0/snippets/evzijst/kypj -F files=image.png

PUT /2.0/snippets/evzijst/kypj HTTP/1.1
Content-Length: 149
Content-Type: multipart/form-data; boundary=----------------------------ef8871065a86

------------------------------ef8871065a86
Content-Disposition: form-data; name="files"

image.png
------------------------------ef8871065a86--

The explicit use of the files element in multipart/related and
multipart/form-data is only required when deleting files.
The default mode of operation is for file parts to be processed,
regardless of whether or not they are listed in files, as a
convenience to the client.

operationId: Snippets_updateSnippet

Parameters

Name In Required Type Description
encoded_id path required string

The snippet id.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The updated snippet object.

401

If the snippet is private and the request was not authenticated.

403

If authenticated user does not have permission to update the private snippet.

404

If the snippet does not exist.

PUT /snippets/{workspace}/{encoded_id}
PUT /snippets/{workspace}/{encoded_id}/comments/{comment_id}

Updates a comment.

The only required field in the body is content.raw.

Comments can only be updated by their author.

operationId: Snippets_updateComment

Parameters

Name In Required Type Description
comment_id path required integer

The id of the comment.

encoded_id path required string

The snippet id.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Request Body

required

The contents to update the comment to.

application/json
schema snippet_comment
Property Type Required
type string required
links object optional
html object optional
href string optional
name string optional
self object optional
href string optional
name string optional
snippet object optional
type string required
id integer optional
scm string optional
owner object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
title string optional
creator object optional
type string required
uuid string optional
links object optional
avatar object optional
username string optional
created_on string optional
display_name string optional
created_on string optional
is_private boolean optional
updated_on string optional

Responses

200

The updated comment object.

403

If the authenticated user does not have access to the snippet.

404

If the comment or snippet does not exist.

PUT /snippets/{workspace}/{encoded_id}/comments/{comment_id}
PUT /snippets/{workspace}/{encoded_id}/watch

Used to start watching a specific snippet. Returns 204 (No Content).

operationId: Snippets_watchSnippet

Parameters

Name In Required Type Description
encoded_id path required string

The snippet id.

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

204

Indicates the authenticated user is now watching the snippet.

401

If the request was not authenticated.

404

If the snippet does not exist.

PUT /snippets/{workspace}/{encoded_id}/watch
PUT /snippets/{workspace}/{encoded_id}/{node_id}

Identical to UPDATE /snippets/encoded_id, except that this endpoint
takes an explicit commit revision. Only the snippet’s “HEAD”/”tip”
(most recent) version can be updated and requests on all other,
older revisions fail by returning a 405 status.

Usage of this endpoint over the unrestricted /snippets/encoded_id
could be desired if the caller wants to be sure no concurrent
modifications have taken place between the moment of the UPDATE
request and the original GET.

This can be considered a so-called “Compare And Swap”, or CAS
operation.

Other than that, the two endpoints are identical in behavior.

operationId: Snippets_updatePreviousRevision

Parameters

Name In Required Type Description
encoded_id path required string

The snippet id.

node_id path required string

A commit revision (SHA1).

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The updated snippet object.

401

If the snippet is private and the request was not authenticated.

403

If authenticated user does not have permission to update the private snippet.

404

If the snippet or the revision does not exist.

405

If {node_id} is not the latest revision.

PUT /snippets/{workspace}/{encoded_id}/{node_id}

Ssh 1 endpoints

PUT /users/{selected_user}/ssh-keys/{key_id}

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}
operationId: Ssh_updateSshKeyComment

Parameters

Name In Required Type Description
key_id path required string

The SSH key’s UUID value.

selected_user path required string

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

Request Body

The updated SSH key object

application/json
schema ssh_account_key
Property Type Required
type string required
key string optional
uuid string optional
label string optional
links object optional
self object optional
href string optional
name string optional
comment string optional
last_used string optional
created_on string optional
owner object optional
type string required
uuid string optional
links object optional
avatar object optional
href string optional
name string optional
username string optional
created_on string optional
display_name string optional

Responses

200

The newly updated SSH key.

400

If the submitted key or related value is invalid

403

If the current user does not have permission to add a key for the specified user

404

If the specified user does not exist

PUT /users/{selected_user}/ssh-keys/{key_id}

Workspaces 1 endpoints

PUT /workspaces/{workspace}/hooks/{uid}

Updates the specified webhook subscription.

The following properties can be mutated:

  • description
  • url
  • secret
  • active
  • events

The hook’s secret is used as a key to generate the HMAC hex digest sent in the
X-Hub-Signature header at delivery time. This signature is only generated
when the hook has a secret.

Set the hook’s secret by passing the new value in the secret field. Passing a
null value in the secret field will remove the secret from the hook. The
hook’s secret can be left unchanged by not passing the secret field in the
request.

operationId: Workspaces_updateWebhook

Parameters

Name In Required Type Description
uid path required string

Installed webhook’s ID

workspace path required string

This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Responses

200

The webhook subscription object.

403

If the authenticated user does not have permission to update the webhook.

404

If the webhook or workspace does not exist.

PUT /workspaces/{workspace}/hooks/{uid}

Schemas

object A_pull_request_task
{
  "allOf": [
    {
      "$ref": "#/components/schemas/task"
    },
    {
      "type": "object",
      "title": "Pull Request Task",
      "properties": {
        "links": {
          "type": "object",
          "properties": {
            "html": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            },
            "self": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            }
          }
        }
      },
      "description": "A pull request task."
    }
  ]
}
object A_pullrequest_comment_task
{
  "allOf": [
    {
      "$ref": "#/components/schemas/A_pull_request_task"
    },
    {
      "type": "object",
      "title": "Pull Request Comment Task",
      "properties": {
        "comment": {
          "$ref": "#/components/schemas/comment"
        }
      },
      "description": "A pullrequest comment task"
    }
  ]
}
object A_pullrequest_task_create
{
  "type": "object",
  "title": "Pull Request Task Create",
  "required": [
    "content"
  ],
  "properties": {
    "comment": {
      "$ref": "#/components/schemas/comment"
    },
    "content": {
      "type": "object",
      "title": "Task Raw Content",
      "required": [
        "raw"
      ],
      "properties": {
        "raw": {
          "type": "string",
          "description": "The task contents"
        }
      },
      "description": "task raw content"
    },
    "pending": {
      "type": "boolean"
    }
  },
  "description": "A pullrequest task create"
}
object A_pullrequest_task_update
{
  "type": "object",
  "title": "Pull Request Task Update",
  "properties": {
    "state": {
      "enum": [
        "RESOLVED",
        "UNRESOLVED"
      ],
      "type": "string"
    },
    "content": {
      "type": "object",
      "title": "Task Raw Content",
      "required": [
        "raw"
      ],
      "properties": {
        "raw": {
          "type": "string",
          "description": "The task contents"
        }
      },
      "description": "task raw content"
    }
  },
  "description": "A pullrequest task update"
}
array ReportsBulkCreateOrUpdateAnnotationsRequest
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/report_annotation"
  },
  "maxItems": 100,
  "minItems": 1
}
array ReportsBulkCreateOrUpdateAnnotationsResponse
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/report_annotation"
  }
}
object account
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Account",
      "properties": {
        "uuid": {
          "type": "string"
        },
        "links": {
          "$ref": "#/components/schemas/account_links"
        },
        "username": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_\\-]+$"
        },
        "created_on": {
          "type": "string",
          "format": "date-time"
        },
        "display_name": {
          "type": "string"
        }
      },
      "description": "An account object.",
      "additionalProperties": true
    }
  ]
}
object account_links
{
  "type": "object",
  "title": "Account Links",
  "properties": {
    "avatar": {
      "$ref": "#/components/schemas/link"
    }
  },
  "description": "Links related to an Account.",
  "additionalProperties": true
}
object app_user
{
  "allOf": [
    {
      "$ref": "#/components/schemas/account"
    },
    {
      "type": "object",
      "title": "App User",
      "properties": {
        "kind": {
          "type": "string",
          "description": "The kind of App User."
        },
        "account_id": {
          "type": "string",
          "description": "The user's Atlassian account ID."
        },
        "account_status": {
          "type": "string",
          "description": "The status of the account. Currently the only possible value is \"active\", but more values may be added in the future."
        }
      },
      "description": "An app user object.",
      "additionalProperties": true
    }
  ]
}
object application_property
{
  "type": "object",
  "title": "Application Property",
  "properties": {
    "_attributes": {
      "type": "array",
      "items": {
        "enum": [
          "public",
          "read_only"
        ],
        "type": "string"
      }
    }
  },
  "description": "An application property. It is a caller defined JSON object that Bitbucket will store and return. \nThe `_attributes` field at its top level can be used to control who is allowed to read and update the property. \nThe keys of the JSON object must match an allowed pattern. For details, \nsee [Application properties](https://dac-static.atlassian.com).\n",
  "additionalProperties": true
}
object author
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Author",
      "properties": {
        "raw": {
          "type": "string",
          "description": "The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket."
        },
        "user": {
          "$ref": "#/components/schemas/account"
        }
      },
      "description": "The author of a change in a repository",
      "additionalProperties": true
    }
  ]
}
object base_commit
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Base Commit",
      "properties": {
        "date": {
          "type": "string",
          "format": "date-time"
        },
        "hash": {
          "type": "string",
          "pattern": "[0-9a-f]{7,}?"
        },
        "author": {
          "$ref": "#/components/schemas/author"
        },
        "message": {
          "type": "string"
        },
        "parents": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/base_commit"
          },
          "minItems": 0
        },
        "summary": {
          "type": "object",
          "properties": {
            "raw": {
              "type": "string",
              "description": "The text as it was typed by a user."
            },
            "html": {
              "type": "string",
              "description": "The user's content rendered as HTML."
            },
            "markup": {
              "enum": [
                "markdown",
                "creole",
                "plaintext"
              ],
              "type": "string",
              "description": "The type of markup language the raw content is to be interpreted in."
            }
          }
        }
      },
      "description": "The common base type for both repository and snippet commits.",
      "additionalProperties": true
    }
  ]
}
object bitbucket.apps.permissions.serializers.ProjectPermissionUpdateSchema
{
  "type": "object",
  "required": [
    "permission"
  ],
  "properties": {
    "permission": {
      "enum": [
        "read",
        "write",
        "create-repo",
        "admin"
      ],
      "type": "string"
    }
  }
}
object bitbucket.apps.permissions.serializers.RepoPermissionUpdateSchema
{
  "type": "object",
  "required": [
    "permission"
  ],
  "properties": {
    "permission": {
      "enum": [
        "read",
        "write",
        "admin"
      ],
      "type": "string"
    }
  }
}
object branch
{
  "allOf": [
    {
      "$ref": "#/components/schemas/ref"
    },
    {
      "type": "object",
      "title": "Branch",
      "properties": {
        "merge_strategies": {
          "type": "array",
          "items": {
            "enum": [
              "merge_commit",
              "squash",
              "fast_forward"
            ],
            "type": "string"
          },
          "description": "Available merge strategies for pull requests targeting this branch."
        },
        "default_merge_strategy": {
          "type": "string",
          "description": "The default merge strategy for pull requests targeting this branch."
        }
      },
      "description": "A branch object, representing a branch in a repository.",
      "additionalProperties": true
    }
  ]
}
object branching_model
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Branching Model",
      "properties": {
        "production": {
          "type": "object",
          "required": [
            "name",
            "use_mainbranch"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty."
            },
            "branch": {
              "$ref": "#/components/schemas/branch"
            },
            "use_mainbranch": {
              "type": "boolean",
              "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`)."
            }
          }
        },
        "development": {
          "type": "object",
          "required": [
            "name",
            "use_mainbranch"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty."
            },
            "branch": {
              "$ref": "#/components/schemas/branch"
            },
            "use_mainbranch": {
              "type": "boolean",
              "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`)."
            }
          }
        },
        "branch_types": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "prefix"
            ],
            "properties": {
              "kind": {
                "enum": [
                  "feature",
                  "bugfix",
                  "release",
                  "hotfix"
                ],
                "type": "string",
                "description": "The kind of branch."
              },
              "prefix": {
                "type": "string",
                "description": "The prefix for this branch type. A branch with this prefix will be classified as per `kind`. The prefix must be a valid prefix for a branch and must always exist. It cannot be blank, empty or `null`."
              }
            }
          },
          "maxItems": 4,
          "minItems": 0,
          "description": "The active branch types.",
          "uniqueItems": true
        }
      },
      "description": "A repository's branching model",
      "additionalProperties": true
    }
  ]
}
object branching_model_settings
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Branching Model Settings",
      "properties": {
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            }
          }
        },
        "production": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The configured branch. It must be `null` when `use_mainbranch` is `true`. Otherwise it must be a non-empty value. It is possible for the configured branch to not exist (e.g. it was deleted after the settings are set). In this case `is_valid` will be `false`. The branch must exist when updating/setting the `name` or an error will occur."
            },
            "enabled": {
              "type": "boolean",
              "description": "Indicates if branch is enabled or not."
            },
            "is_valid": {
              "type": "boolean",
              "description": "Indicates if the configured branch is valid, that is, if the configured branch actually exists currently. Is always `true` when `use_mainbranch` is `true` (even if the main branch does not exist). This field is read-only. This field is ignored when updating/creating settings."
            },
            "use_mainbranch": {
              "type": "boolean",
              "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`). When `true` the `name` must be `null` or not provided. When `false` the `name` must contain a non-empty branch name."
            }
          }
        },
        "development": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The configured branch. It must be `null` when `use_mainbranch` is `true`. Otherwise it must be a non-empty value. It is possible for the configured branch to not exist (e.g. it was deleted after the settings are set). In this case `is_valid` will be `false`. The branch must exist when updating/setting the `name` or an error will occur."
            },
            "is_valid": {
              "type": "boolean",
              "description": "Indicates if the configured branch is valid, that is, if the configured branch actually exists currently. Is always `true` when `use_mainbranch` is `true` (even if the main branch does not exist). This field is read-only. This field is ignored when updating/creating settings."
            },
            "use_mainbranch": {
              "type": "boolean",
              "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`). When `true` the `name` must be `null` or not provided. When `false` the `name` must contain a non-empty branch name."
            }
          }
        },
        "branch_types": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "enum": [
                  "feature",
                  "bugfix",
                  "release",
                  "hotfix"
                ],
                "type": "string",
                "description": "The kind of the branch type."
              },
              "prefix": {
                "type": "string",
                "description": "The prefix for this branch type. A branch with this prefix will be classified as per `kind`. The `prefix` of an enabled branch type must be a valid branch prefix.Additionally, it cannot be blank, empty or `null`. The `prefix` for a disabled branch type can be empty or invalid."
              },
              "enabled": {
                "type": "boolean",
                "description": "Whether the branch type is enabled or not. A disabled branch type may contain an invalid `prefix`."
              }
            }
          },
          "maxItems": 4,
          "minItems": 0,
          "uniqueItems": true
        }
      },
      "description": "A repository's branching model settings",
      "additionalProperties": true
    }
  ]
}
object branchrestriction
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Branch Restriction",
      "properties": {
        "users": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/account"
          },
          "minItems": 0
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/group"
          },
          "minItems": 0
        }
      },
      "description": "A branch restriction rule.",
      "additionalProperties": true
    }
  ]
}
object comment
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Comment",
      "properties": {
        "id": {
          "type": "integer"
        },
        "user": {
          "$ref": "#/components/schemas/account"
        },
        "links": {
          "type": "object",
          "properties": {
            "code": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            },
            "html": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            },
            "self": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            }
          }
        },
        "inline": {
          "type": "object",
          "required": [
            "path"
          ],
          "properties": {
            "to": {
              "type": "integer",
              "minimum": 1,
              "description": "The comment's anchor line in the new version of the file. If the 'from' line is also provided, this value will be removed."
            },
            "from": {
              "type": "integer",
              "minimum": 1,
              "description": "The comment's anchor line in the old version of the file."
            },
            "path": {
              "type": "string",
              "description": "The path of the file this comment is anchored to."
            }
          }
        },
        "parent": {
          "$ref": "#/components/schemas/comment"
        },
        "content": {
          "type": "object",
          "properties": {
            "raw": {
              "type": "string",
              "description": "The text as it was typed by a user."
            },
            "html": {
              "type": "string",
              "description": "The user's content rendered as HTML."
            },
            "markup": {
              "enum": [
                "markdown",
                "creole",
                "plaintext"
              ],
              "type": "string",
              "description": "The type of markup language the raw content is to be interpreted in."
            }
          }
        },
        "deleted": {
          "type": "boolean"
        },
        "created_on": {
          "type": "string",
          "format": "date-time"
        },
        "updated_on": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "The base type for all comments. This type should be considered abstract. Each of the \"commentable\" resources defines its own subtypes (e.g. `issue_comment`).",
      "additionalProperties": true
    }
  ]
}
object comment_resolution
{
  "type": "object",
  "title": "Comment Resolution",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string"
    },
    "user": {
      "$ref": "#/components/schemas/account"
    },
    "created_on": {
      "type": "string",
      "format": "date-time",
      "description": "The ISO8601 timestamp the resolution was created."
    }
  },
  "description": "The resolution object for a Comment.",
  "additionalProperties": true
}
object commit
{
  "allOf": [
    {
      "$ref": "#/components/schemas/base_commit"
    },
    {
      "type": "object",
      "title": "Commit",
      "properties": {
        "repository": {
          "$ref": "#/components/schemas/repository"
        },
        "participants": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/participant"
          },
          "minItems": 0
        }
      },
      "description": "A repository commit object.",
      "additionalProperties": true
    }
  ]
}
object commit_comment
{
  "allOf": [
    {
      "$ref": "#/components/schemas/comment"
    },
    {
      "type": "object",
      "title": "Commit Comment",
      "properties": {
        "commit": {
          "$ref": "#/components/schemas/commit"
        }
      },
      "description": "A commit comment.",
      "additionalProperties": true
    }
  ]
}
object commit_file
{
  "type": "object",
  "title": "Commit File",
  "required": [
    "type"
  ],
  "properties": {
    "path": {
      "type": "string",
      "description": "The path in the repository"
    },
    "type": {
      "type": "string"
    },
    "commit": {
      "$ref": "#/components/schemas/commit"
    },
    "attributes": {
      "enum": [
        "link",
        "executable",
        "subrepository",
        "binary",
        "lfs"
      ],
      "type": "string"
    },
    "escaped_path": {
      "type": "string",
      "description": "The escaped version of the path as it appears in a diff. If the path does not require escaping this will be the same as path."
    }
  },
  "description": "A file object, representing a file at a commit in a repository",
  "additionalProperties": true
}
object commitstatus
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Commit Status",
      "properties": {
        "key": {
          "type": "string",
          "description": "An identifier for the status that's unique to\n        its type (current \"build\" is the only supported type) and the vendor,\n        e.g. BB-DEPLOY"
        },
        "url": {
          "type": "string",
          "description": "A URL linking back to the vendor or build system, for providing more information about whatever process produced this status. Accepts context variables `repository` and `commit` that Bitbucket will evaluate at runtime whenever at runtime. For example, one could use https://foo.com/builds/{repository.full_name} which Bitbucket will turn into https://foo.com/builds/foo/bar at render time."
        },
        "name": {
          "type": "string",
          "description": "An identifier for the build itself, e.g. BB-DEPLOY-1"
        },
        "uuid": {
          "type": "string",
          "description": "The commit status' id."
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            },
            "commit": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            }
          }
        },
        "state": {
          "enum": [
            "FAILED",
            "INPROGRESS",
            "STOPPED",
            "SUCCESSFUL"
          ],
          "type": "string",
          "description": "Provides some indication of the status of this commit"
        },
        "refname": {
          "type": "string",
          "description": "\nThe name of the ref that pointed to this commit at the time the status\nobject was created. Note that this the ref may since have moved off of\nthe commit. This optional field can be useful for build systems whose\nbuild triggers and configuration are branch-dependent (e.g. a Pipeline\nbuild).\nIt is legitimate for this field to not be set, or even apply (e.g. a\nstatic linting job)."
        },
        "created_on": {
          "type": "string",
          "format": "date-time"
        },
        "updated_on": {
          "type": "string",
          "format": "date-time"
        },
        "description": {
          "type": "string",
          "description": "A description of the build (e.g. \"Unit tests in Bamboo\")"
        }
      },
      "description": "A commit status object.",
      "additionalProperties": true
    }
  ]
}
object component
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Component",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            }
          }
        }
      },
      "description": "A component as defined in a repository's issue tracker.",
      "additionalProperties": true
    }
  ]
}
object ddev_report
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "description": "A report for a commit.",
      "additionalProperties": true
    }
  ],
  "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/commits/{commitHash}/reports/{uuid}",
  "x-bb-default-fields": [
    "uuid",
    "commitHash"
  ]
}
object default_reviewer_and_type
{
  "type": "object",
  "title": "Default Reviewer and Type",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string"
    },
    "user": {
      "$ref": "#/components/schemas/user"
    },
    "reviewer_type": {
      "type": "string"
    }
  },
  "description": "Object containing a user that is a default reviewer and the type of reviewer",
  "additionalProperties": true
}
object deploy_key
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deploy Key",
      "properties": {
        "key": {
          "type": "string",
          "description": "The deploy key value."
        },
        "label": {
          "type": "string",
          "description": "The user-defined label for the deploy key"
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "object",
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "type": "string"
                }
              },
              "description": "A link to a resource related to this object."
            }
          }
        },
        "owner": {
          "$ref": "#/components/schemas/account"
        },
        "comment": {
          "type": "string",
          "description": "The comment parsed from the deploy key (if present)"
        },
        "added_on": {
          "type": "string",
          "format": "date-time"
        },
        "last_used": {
          "type": "string",
          "format": "date-time"
        },
        "repository": {
          "$ref": "#/components/schemas/repository"
        }
      },
      "description": "Represents deploy key for a repository.",
      "additionalProperties": true
    }
  ]
}
object deployment
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment",
      "properties": {
        "uuid": {
          "type": "string",
          "description": "The UUID identifying the deployment."
        },
        "state": {
          "$ref": "#/components/schemas/deployment_state"
        },
        "release": {
          "$ref": "#/components/schemas/deployment_release"
        },
        "environment": {
          "$ref": "#/components/schemas/deployment_environment"
        }
      },
      "description": "A Bitbucket Deployment.",
      "additionalProperties": true
    }
  ]
}
object deployment_environment
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Environment",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the environment."
        },
        "uuid": {
          "type": "string",
          "description": "The UUID identifying the environment."
        }
      },
      "description": "A Bitbucket Deployment Environment.",
      "additionalProperties": true
    }
  ],
  "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/{uuid}",
  "x-bb-batch-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments_batch",
  "x-bb-batch-max-size": 100,
  "x-bb-default-fields": [
    "uuid"
  ]
}
object deployment_environment_lock
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Environment Lock",
      "properties": {
        "environmentUuid": {
          "type": "string",
          "description": "The UUID identifying the environment."
        }
      },
      "description": "A Bitbucket Deployment Environment Lock.",
      "additionalProperties": true
    }
  ],
  "x-bb-batch-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/locks_batch",
  "x-bb-batch-max-size": 100,
  "x-bb-default-fields": [
    "*",
    "lock_opener.*",
    "owner.*"
  ]
}
object deployment_release
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Release",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Link to the pipeline that produced the release."
        },
        "name": {
          "type": "string",
          "description": "The name of the release."
        },
        "uuid": {
          "type": "string",
          "description": "The UUID identifying the release."
        },
        "commit": {
          "$ref": "#/components/schemas/commit"
        },
        "created_on": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the release was created."
        }
      },
      "description": "A Bitbucket Deployment Release.",
      "additionalProperties": true
    }
  ]
}
object deployment_state
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment State",
      "properties": {},
      "description": "The representation of the progress state of a deployment.",
      "additionalProperties": true
    }
  ]
}
object deployment_state_completed
{
  "allOf": [
    {
      "$ref": "#/components/schemas/deployment_state"
    },
    {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Link to the deployment result."
        },
        "name": {
          "enum": [
            "COMPLETED"
          ],
          "type": "string",
          "description": "The name of deployment state (COMPLETED)."
        },
        "status": {
          "$ref": "#/components/schemas/deployment_state_completed_status"
        },
        "deployer": {
          "$ref": "#/components/schemas/account"
        },
        "start_date": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the deployment was started."
        },
        "completion_date": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the deployment completed."
        }
      },
      "description": "A Bitbucket Deployment COMPLETED deployment state.",
      "additionalProperties": true
    }
  ]
}
object deployment_state_completed_status
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Completed Deployment",
      "properties": {},
      "description": "The status of a completed deployment.",
      "additionalProperties": true
    }
  ]
}
object deployment_state_completed_status_failed
{
  "allOf": [
    {
      "$ref": "#/components/schemas/deployment_state_completed_status"
    },
    {
      "type": "object",
      "properties": {
        "name": {
          "enum": [
            "FAILED"
          ],
          "type": "string",
          "description": "The name of the completed deployment status (FAILED)."
        }
      },
      "description": "A FAILED completed deployment status.",
      "additionalProperties": true
    }
  ]
}
object deployment_state_completed_status_stopped
{
  "allOf": [
    {
      "$ref": "#/components/schemas/deployment_state_completed_status"
    },
    {
      "type": "object",
      "properties": {
        "name": {
          "enum": [
            "STOPPED"
          ],
          "type": "string",
          "description": "The name of the completed deployment status (STOPPED)."
        }
      },
      "description": "A STOPPED completed deployment status.",
      "additionalProperties": true
    }
  ]
}
object deployment_state_completed_status_successful
{
  "allOf": [
    {
      "$ref": "#/components/schemas/deployment_state_completed_status"
    },
    {
      "type": "object",
      "properties": {
        "name": {
          "enum": [
            "SUCCESSFUL"
          ],
          "type": "string",
          "description": "The name of the completed deployment status (SUCCESSFUL)."
        }
      },
      "description": "A SUCCESSFUL completed deployment status.",
      "additionalProperties": true
    }
  ]
}
object deployment_state_in_progress
{
  "allOf": [
    {
      "$ref": "#/components/schemas/deployment_state"
    },
    {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Link to the deployment result."
        },
        "name": {
          "enum": [
            "IN_PROGRESS"
          ],
          "type": "string",
          "description": "The name of deployment state (IN_PROGRESS)."
        },
        "deployer": {
          "$ref": "#/components/schemas/account"
        },
        "start_date": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the deployment was started."
        }
      },
      "description": "A Bitbucket Deployment IN_PROGRESS deployment state.",
      "additionalProperties": true
    }
  ]
}
object deployment_state_undeployed
{
  "allOf": [
    {
      "$ref": "#/components/schemas/deployment_state"
    },
    {
      "type": "object",
      "properties": {
        "name": {
          "enum": [
            "UNDEPLOYED"
          ],
          "type": "string",
          "description": "The name of deployment state (UNDEPLOYED)."
        },
        "trigger_url": {
          "type": "string",
          "format": "uri",
          "description": "Link to trigger the deployment."
        }
      },
      "description": "A Bitbucket Deployment UNDEPLOYED deployment state.",
      "additionalProperties": true
    }
  ]
}
object deployment_variable
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Variable",
      "properties": {
        "key": {
          "type": "string",
          "description": "The unique name of the variable."
        },
        "uuid": {
          "type": "string",
          "description": "The UUID identifying the variable."
        },
        "value": {
          "type": "string",
          "description": "The value of the variable. If the variable is secured, this will be empty."
        },
        "secured": {
          "type": "boolean",
          "description": "If true, this variable will be treated as secured. The value will never be exposed in the logs or the REST API."
        }
      },
      "description": "A Pipelines deployment variable.",
      "additionalProperties": true
    }
  ]
}
object deployments_ddev_deployment_environment
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Environment",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the environment."
        },
        "uuid": {
          "type": "string",
          "description": "The UUID identifying the environment."
        }
      },
      "description": "A Bitbucket Deployment Environment.",
      "additionalProperties": true
    }
  ],
  "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/{uuid}",
  "x-bb-batch-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments_batch",
  "x-bb-batch-max-size": 100,
  "x-bb-default-fields": [
    "uuid"
  ]
}
object deployments_ddev_deployment_environment_lock
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Environment Lock",
      "properties": {
        "environmentUuid": {
          "type": "string",
          "description": "The UUID identifying the environment."
        }
      },
      "description": "A Bitbucket Deployment Environment Lock.",
      "additionalProperties": true
    }
  ],
  "x-bb-batch-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/locks_batch",
  "x-bb-batch-max-size": 100,
  "x-bb-default-fields": [
    "*",
    "lock_opener.*",
    "owner.*"
  ]
}
object deployments_ddev_paginated_environments
{
  "type": "object",
  "title": "Paginated Deployment Environments",
  "properties": {
    "next": {
      "type": "string",
      "format": "uri",
      "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."
    },
    "page": {
      "type": "integer",
      "description": "Page number of the current results. This is an optional element that is not provided in all responses."
    },
    "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."
    },
    "values": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/deployments_ddev_deployment_environment"
      },
      "minItems": 0,
      "description": "The values of the current page."
    },
    "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."
    },
    "previous": {
      "type": "string",
      "format": "uri",
      "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."
    }
  },
  "description": "A paged list of environments"
}
object deployments_stg_west_deployment_environment
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Environment",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the environment."
        },
        "uuid": {
          "type": "string",
          "description": "The UUID identifying the environment."
        }
      },
      "description": "A Bitbucket Deployment Environment.",
      "additionalProperties": true
    }
  ],
  "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/{uuid}",
  "x-bb-batch-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments_batch",
  "x-bb-batch-max-size": 100,
  "x-bb-default-fields": [
    "uuid"
  ]
}
object deployments_stg_west_deployment_environment_lock
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Deployment Environment Lock",
      "properties": {
        "environmentUuid": {
          "type": "string",
          "description": "The UUID identifying the environment."
        }
      },
      "description": "A Bitbucket Deployment Environment Lock.",
      "additionalProperties": true
    }
  ],
  "x-bb-batch-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/locks_batch",
  "x-bb-batch-max-size": 100,
  "x-bb-default-fields": [
    "*",
    "lock_opener.*",
    "owner.*"
  ]
}
object deployments_stg_west_paginated_environments
{
  "type": "object",
  "title": "Paginated Deployment Environments",
  "properties": {
    "next": {
      "type": "string",
      "format": "uri",
      "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."
    },
    "page": {
      "type": "integer",
      "description": "Page number of the current results. This is an optional element that is not provided in all responses."
    },
    "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."
    },
    "values": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/deployments_stg_west_deployment_environment"
      },
      "minItems": 0,
      "description": "The values of the current page."
    },
    "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."
    },
    "previous": {
      "type": "string",
      "format": "uri",
      "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."
    }
  },
  "description": "A paged list of environments"
}
object diffstat
{
  "type": "object",
  "title": "Diff Stat",
  "required": [
    "type"
  ],
  "properties": {
    "new": {
      "$ref": "#/components/schemas/commit_file"
    },
    "old": {
      "$ref": "#/components/schemas/commit_file"
    },
    "type": {
      "type": "string"
    },
    "status": {
      "enum": [
        "added",
        "removed",
        "modified",
        "renamed"
      ],
      "type": "string"
    },
    "lines_added": {
      "type": "integer"
    },
    "lines_removed": {
      "type": "integer"
    }
  },
  "description": "A diffstat object that includes a summary of changes made to a file between two commits.",
  "additionalProperties": true
}
object effective_repo_branching_model
{
  "allOf": [
    {
      "$ref": "#/components/schemas/object"
    },
    {
      "type": "object",
      "title": "Effective Repository Branching Model",
      "properties": {
        "production": {
          "type": "object",
          "required": [
            "name",
            "use_mainbranch"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty."
            },
            "branch": {
              "$ref": "#/components/schemas/branch"
            },
            "use_mainbranch": {
              "type": "boolean",
              "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`)."
            }
          }
        },
        "development": {
          "type": "object",
          "required": [
            "name",
            "use_mainbranch"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty."
            },
            "branch": {
              "$ref": "#/components/schemas/branch"
            },
            "use_mainbranch": {
              "type": "boolean",
              "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`)."
            }
          }
        },
        "branch_types": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "prefix"
            ],
            "properties": {
              "kind": {
                "enum": [
                  "feature",
                  "bugfix",
                  "release",
                  "hotfix"
                ],
                "type": "string",
                "description": "The kind of branch."
              },
              "prefix": {
                "type": "string",
                "description": "The prefix for this branch type. A branch with this prefix will be classified as per `kind`. The prefix must be a valid prefix for a branch and must always exist. It cannot be blank, empty or `null`."
              }
            }
          },
          "maxItems": 4,
          "minItems": 0,
          "description": "The active branch types.",
          "uniqueItems": true
        }
      },
      "description": "A repository's effective branching model",
      "additionalProperties": true
    }
  ]
}
object error
{
  "type": "object",
  "title": "Error",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string"
    },
    "error": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "data": {
          "type": "object",
          "properties": {},
          "description": "Optional structured data that is endpoint-specific.",
          "additionalProperties": true
        },
        "detail": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  },
  "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`.",
  "additionalProperties": true
}

Versions

Version Endpoints Schemas Ingested Status
2.0 318 216 2026-05-11 current
2.0 318 216 2026-04-16