Git code hosting and collaboration
developer.atlassian.com/cloud/bitbucket/rest ↗Query structured spec data via REST or MCP. Get exactly what your agent needs.
https://api.bitbucket.org/2.0
/addon
Deletes the application 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 Marketplace need not use this endpoint as
updates for those applications can be sent out via the
UI of that section.
$ curl -X DELETE https://api.bitbucket.org/2.0/addon \
-H "Authorization: JWT <JWT Token>"
Request has succeeded. The application has been deleted for the user.
No authorization.
Improper authentication.
DELETE /addon
/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.
Request has succeeded. The installation has been updated to the new descriptor.
Scopes have increased or decreased to none.
No authorization.
Improper authentication.
PUT /addon
/addon/linkers
Gets a list of all linkers
for the authenticated application.
Successful.
Authentication must use app JWT
GET /addon/linkers
/addon/linkers/{linker_key}
Gets a linker specified by linker_key
for the authenticated application.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| linker_key | path | required | string | The unique key of a linker module |
Successful.
Authentication must use app JWT
The linker does not exist.
GET /addon/linkers/{linker_key}
/addon/linkers/{linker_key}/values
Delete all linker values for the
specified linker of the authenticated application.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| linker_key | path | required | string | The unique key of a linker module |
Successfully deleted the linker values.
Authentication must use app JWT
The linker does not exist.
DELETE /addon/linkers/{linker_key}/values
/addon/linkers/{linker_key}/values
Gets a list of all 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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| linker_key | path | required | string | The unique key of a linker module |
Successful.
Authentication must use app JWT
The linker does not exist.
GET /addon/linkers/{linker_key}/values
/addon/linkers/{linker_key}/values
Creates a linker value for the specified
linker of 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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| linker_key | path | required | string | The unique key of a linker module |
Successfully created the linker value.
Authentication must use app JWT
The linker does not exist.
The linker already has the value being added.
POST /addon/linkers/{linker_key}/values
/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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| linker_key | path | required | string | The unique key of a linker module |
Successfully updated the linker values.
Invalid input.
Authentication must use app JWT
The linker does not exist.
PUT /addon/linkers/{linker_key}/values
/addon/linkers/{linker_key}/values/{value_id}
Delete a single linker value
of the authenticated application.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| linker_key | path | required | string | The unique key of a linker module |
| value_id | path | required | integer | The numeric ID of the linker value. |
Successfully deleted the linker value.
Authentication must use app JWT
The linker value does not exist.
DELETE /addon/linkers/{linker_key}/values/{value_id}
/addon/linkers/{linker_key}/values/{value_id}
Get a single linker value
of the authenticated application.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| linker_key | path | required | string | The unique key of a linker module |
| value_id | path | required | integer | The numeric ID of the linker value. |
Successful.
Authentication must use app JWT
The linker value does not exist.
GET /addon/linkers/{linker_key}/values/{value_id}
/repositories/{workspace}/{repo_slug}/branch-restrictions
Returns a paginated list of all branch restrictions on the
repository.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
| kind | query | optional | string | Branch restrictions of this type |
| pattern | query | optional | string | Branch restrictions applied to branches of this pattern |
A paginated list of branch restrictions
If the request was not authenticated
If the authenticated user does not have admin access to the repository
If the repository does not exist
GET /repositories/{workspace}/{repo_slug}/branch-restrictions
/repositories/{workspace}/{repo_slug}/branch-restrictions
Creates a new branch restriction rule for a repository.
kind describes what will be restricted. Allowed values include:
push, force, delete, restrict_merges, require_tasks_to_be_completed,
require_approvals_to_merge, require_default_reviewer_approvals_to_merge,
require_no_changes_requested, require_passing_builds_to_merge, require_commits_behind,
reset_pullrequest_approvals_on_change, smart_reset_pullrequest_approvals,
reset_pullrequest_changes_requested_on_change, require_all_dependencies_merged,
enforce_merge_checks, and allow_auto_merge_when_builds_pass.
Different kinds of branch restrictions have different requirements:
push and restrict_merges require users and groups to beThe restriction applies to all branches that match. There are
two ways to match a branch. It is configured in branch_match_kind:
glob: Matches a branch against the pattern. A '*' inpattern will expand to match zero or more characters, and every'foo*' will match'foo' and 'foobar', but not 'barfoo'. '*' will match allbranching_model: Matches a branch against the repository’sbranch_type controls the type of branchproduction, development,bugfix, release, feature and hotfix.The combination of kind and match must be unique. This means that
two glob restrictions in a repository cannot have the same kind and
pattern. Additionally, two branching_model restrictions in a
repository cannot have the same kind and branch_type.
users and groups are lists of users and groups that are except from
the restriction. They can only be configured in push and
restrict_merges restrictions. The push restriction stops a user
pushing to matching branches unless that user is in users or is a
member of a group in groups. The restrict_merges stops a user
merging pull requests to matching branches unless that user is in
users or is a member of a group in groups. Adding new users or
groups to an existing restriction should be done via PUT.
Note that branch restrictions with overlapping matchers is allowed,
but the resulting behavior may be surprising.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The new rule
application/json
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 |
A paginated list of branch restrictions
If the request was not authenticated
If the authenticated user does not have admin access to the repository
If the repository does not exist
POST /repositories/{workspace}/{repo_slug}/branch-restrictions
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
Deletes an existing branch restriction rule.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
If the request was not authenticated
If the authenticated user does not have admin access to the repository
If the repository or branch restriction id does not exist
DELETE /repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
Returns a specific branch restriction rule.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The branch restriction rule
If the request was not authenticated
If the authenticated user does not have admin access to the repository
If the repository or branch restriction id does not exist
GET /repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
/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.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The new version of the existing rule
application/json
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 |
The updated branch restriction rule
If the request was not authenticated
If the authenticated user does not have admin access to the repository
If the repository or branch restriction id does not exist
PUT /repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
/repositories/{workspace}/{repo_slug}/branching-model
Return the branching model as applied to the repository. This view is
read-only. The branching model settings can be changed using the
settings API.
The returned object:
development property. development.branch containsdevelopment branch. development.branch will not be presentproduction property. production will notproduction is disabled.production.branch contains the actual branch object that isproduction branch. production.branch willbranch_types array which contains all enabled branch| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The branching model object
If the request was not authenticated
If the authenticated user does not have read access to the repository
If the repository does not exist
GET /repositories/{workspace}/{repo_slug}/branching-model
/repositories/{workspace}/{repo_slug}/branching-model/settings
Return the branching model configuration for a repository. The returned
object:
development property for the development branch.production property for the production branch. Thebranch_types contains all the branch types.This is the raw configuration for the branching model. A client
wishing to see the branching model with its actual current branches may
find the active model API more useful.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The branching model configuration
If the request was not authenticated
If the authenticated user does not have admin access to the repository
If the repository does not exist
GET /repositories/{workspace}/{repo_slug}/branching-model/settings
/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:
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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The updated branching model configuration
If the request contains invalid branching model configuration
If the request was not authenticated
If the authenticated user does not have admin access to the repository
If the repository does not exist
PUT /repositories/{workspace}/{repo_slug}/branching-model/settings
/repositories/{workspace}/{repo_slug}/effective-branching-model
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The effective branching model object
If the request was not authenticated
If the authenticated user does not have read access to the repository
If the repository does not exist
GET /repositories/{workspace}/{repo_slug}/effective-branching-model
/workspaces/{workspace}/projects/{project_key}/branching-model
Return the branching model set at the project level. This view is
read-only. The branching model settings can be changed using the
settings
API.
The returned object:
development property. development.name isproduction property. production will notproduction is disabled.production.name is the user-specified branch that can bebranch_types array which contains all enabled branch| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The branching model object
If the request was not authenticated
If the authenticated user does not have read access to the project
If the project does not exist
GET /workspaces/{workspace}/projects/{project_key}/branching-model
/workspaces/{workspace}/projects/{project_key}/branching-model/settings
Return the branching model configuration for a project. The returned
object:
development property for the development branch.production property for the production branch. Thebranch_types contains all the branch types.This is the raw configuration for the branching model. A client
wishing to see the branching model with its actual current branches may find the
active model API
more useful.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The branching model configuration
If the request was not authenticated
If the authenticated user does not have admin access to the project
If the project does not exist
GET /workspaces/{workspace}/projects/{project_key}/branching-model/settings
/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:
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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The updated branching model configuration
If the request contains an invalid branching model configuration
If the request was not authenticated
If the authenticated user does not have admin access to the project
If the project does not exist
PUT /workspaces/{workspace}/projects/{project_key}/branching-model/settings
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses
Returns all statuses (e.g. build results) for a specific commit.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
| q | query | optional | string | Query string to narrow down the response as per |
| sort | query | optional | string | Field by which the results should be sorted as per |
A paginated list of all commit statuses for this commit.
If the repository is private and the request was not authenticated.
If the repository or commit does not exist
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build
Creates a new build status against the specified commit.
If the specified key already exists, the existing status object will
be overwritten.
Example:
curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{
"key": "MY-BUILD",
"state": "SUCCESSFUL",
"description": "42 tests passed",
"url": "https://www.example.org/my-build-result"
}'
When creating a new commit status, you can use a URI template for the URL.
Templates are URLs that contain variable names that Bitbucket will
evaluate at runtime whenever the URL is displayed anywhere similar to
parameter substitution in
Bitbucket Connect.
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.
The context variables available are repository and commit.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The new commit status object.
application/json
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 |
The newly created build status object.
If the repository is private and the request was not authenticated.
If the repository, commit, or build status key does not exist
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
Returns the specified build status for a commit.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The build status object with the specified key.
If the repository is private and the request was not authenticated.
If the repository, commit, or build status key does not exist
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
/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:
statenamedescriptionurlrefnameThe key cannot be changed.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The updated build status object
application/json
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 |
The updated build status object.
If the repository is private and the request was not authenticated.
If the repository or build does not exist
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
/repositories/{workspace}/{repo_slug}/commit/{commit}
Returns the specified commit.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The commit object
If the specified commit or repository does not exist.
GET /repositories/{workspace}/{repo_slug}/commit/{commit}
/repositories/{workspace}/{repo_slug}/commit/{commit}/approve
Redact the authenticated user’s approval of the specified commit.
This operation is only available to users that have explicit access to
the repository. In contrast, just the fact that a repository is
publicly accessible to users does not give them the ability to approve
commits.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
An empty response indicating the authenticated user’s approval has been withdrawn.
If the specified commit, or the repository does not exist.
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/approve
/repositories/{workspace}/{repo_slug}/commit/{commit}/approve
Approve the specified commit as the authenticated user.
This operation is only available to users that have explicit access to
the repository. In contrast, just the fact that a repository is
publicly accessible to users does not give them the ability to approve
commits.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The participant object recording that the authenticated user approved the commit.
If the specified commit, or the repository does not exist.
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/approve
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments
Returns the commit’s comments.
This includes both global and inline comments.
The default sorting is oldest to newest and can be overridden with
the sort query parameter.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
| q | query | optional | string | Query string to narrow down the response as per |
| sort | query | optional | string | Field by which the results should be sorted as per |
A paginated list of commit comments.
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/comments
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments
Creates new comment on the specified commit.
To post a reply to an existing comment, include the parent.id field:
$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/db9ba1e031d07a02603eae0e559a7adc010257fc/comments/ \
-X POST -u evzijst \
-H 'Content-Type: application/json' \
-d '{"content": {"raw": "One more thing!"},
"parent": {"id": 5728901}}'
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified comment.
application/json
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 |
The newly created comment.
If the comment was detected as spam, or if the parent comment is not attached to the same node as the new comment
If a parent ID was passed in that cannot be found
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/comments
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
Deletes the specified commit comment.
Note that deleting comments that have visible replies that point to
them will not really delete the resource. This is to retain the integrity
of the original comment tree. Instead, the deleted element is set to
true and the content is blanked out. The comment will continue to be
returned by the collections and self endpoints.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Indicates the comment was deleted by this action or a previous delete.
If the comment doesn’t exist
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
Returns the specified commit comment.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The commit comment.
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
/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!"}'
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The updated comment.
application/json
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 |
The newly updated comment.
If the comment update was detected as spam
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
/repositories/{workspace}/{repo_slug}/commits
These are the repository’s commits. They are paginated and returned
in reverse chronological order, similar to the output of git log.
Like these tools, the DAG can be filtered.
Returns all commits in the repo in topological order (newest commit
first). All branches and tags are included (similar to
git log --all).
Returns all commits in the repo that are not on master
(similar to git log --all ^master).
Returns all commits that are on refs foo or bar, but not on fu or
fubar (similar to git log foo bar ^fu ^fubar).
An optional path parameter can be specified that will limit the
results to commits that affect that path. path can either be a file
or a directory. If a directory is specified, commits are returned that
have modified any file in the directory tree rooted by path. It is
important to note that if the path parameter is specified, the commits
returned by this endpoint may no longer be a DAG, parent commits that
do not modify the path will be omitted from the response.
Returns all commits that are on refs foo or bar, but not on master
that changed the file README.md.
Returns all commits that are on refs foo or bar, but not on master
that changed to a file in any file in the directory src or its children.
Because the response could include a very large number of commits, it
is paginated. Follow the ‘next’ link in the response to navigate to the
next page of commits. As with other paginated resources, do not
construct your own links.
When the include and exclude parameters are more than can fit in a
query string, clients can use a x-www-form-urlencoded POST instead.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of commits
If the specified repository does not exist.
GET /repositories/{workspace}/{repo_slug}/commits
/repositories/{workspace}/{repo_slug}/commits
Identical to GET /repositories/{workspace}/{repo_slug}/commits,
except that POST allows clients to place the include and exclude
parameters in the request body to avoid URL length issues.
Note that this resource does NOT support new commit creation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of commits
If the specified repository does not exist.
POST /repositories/{workspace}/{repo_slug}/commits
/repositories/{workspace}/{repo_slug}/commits/{revision}
These are the repository’s commits. They are paginated and returned
in reverse chronological order, similar to the output of git log.
Like these tools, the DAG can be filtered.
Returns all commits on ref master (similar to git log master).
Returns all commits on ref dev or foo, except those that are reachable on
master (similar to git log dev foo ^master).
An optional path parameter can be specified that will limit the
results to commits that affect that path. path can either be a file
or a directory. If a directory is specified, commits are returned that
have modified any file in the directory tree rooted by path. It is
important to note that if the path parameter is specified, the commits
returned by this endpoint may no longer be a DAG, parent commits that
do not modify the path will be omitted from the response.
Returns all commits that are on refs dev or foo or bar, but not on master
that changed the file README.md.
Returns all commits that are on refs dev or foo, but not on master
that changed to a file in any file in the directory src or its children.
Because the response could include a very large number of commits, it
is paginated. Follow the ‘next’ link in the response to navigate to the
next page of commits. As with other paginated resources, do not
construct your own links.
When the include and exclude parameters are more than can fit in a
query string, clients can use a x-www-form-urlencoded POST instead.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| revision | path | required | string | A commit SHA1 or ref name. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of commits
If the specified revision does not exist.
GET /repositories/{workspace}/{repo_slug}/commits/{revision}
/repositories/{workspace}/{repo_slug}/commits/{revision}
Identical to GET /repositories/{workspace}/{repo_slug}/commits/{revision},
except that POST allows clients to place the include and exclude
parameters in the request body to avoid URL length issues.
Note that this resource does NOT support new commit creation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| revision | path | required | string | A commit SHA1 or ref name. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of commits
If the specified revision does not exist.
POST /repositories/{workspace}/{repo_slug}/commits/{revision}
/repositories/{workspace}/{repo_slug}/diff/{spec}
Produces a raw git-style diff.
If the spec argument to this API is a single commit, the diff is
produced against the first parent of the specified commit.
Two commits separated by .. may be provided as the spec, e.g.,
3a8b42..9ff173. When two commits are provided and the topic query
parameter is true, this API produces a 2-way three dot diff.
This is the diff between source commit and the merge base of the source
commit and the destination commit. When the topic query param is false,
a simple git-style diff is produced.
The two commits are interpreted as follows:
git diff.While similar to patches, diffs:
path=foo/bar.py query param to filterThe raw diff is returned as-is, in whatever encoding the files in the
repository use. It is not decoded into unicode. As such, the
content-type is text/plain.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| spec | path | required | string | A commit SHA (e.g. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
| context | query | optional | integer | Generate diffs with lines of context instead of the usual three. |
| path | query | optional | string | Limit the diff to a particular file (this parameter |
| ignore_whitespace | query | optional | boolean | Generate diffs that ignore whitespace. |
| binary | query | optional | boolean | Generate diffs that include binary files, true if omitted. |
| renames | query | optional | boolean | Whether to perform rename detection, true if omitted. |
| merge | query | optional | boolean | This parameter is deprecated. The ‘topic’ parameter should be used If true, the source commit is merged into the |
| topic | query | optional | boolean | If true, returns 2-way ‘three-dot’ diff. |
The raw diff
If the diff was too large and timed out.
Since this endpoint does not employ any form of pagination, but
instead returns the diff as a single document, it can run into
trouble on very large diffs. If Bitbucket times out in cases
like these, a 555 status code is returned.
GET /repositories/{workspace}/{repo_slug}/diff/{spec}
/repositories/{workspace}/{repo_slug}/diffstat/{spec}
Produces a response in JSON format with a record for every path
modified, including information on the type of the change and the
number of lines added and removed.
If the spec argument to this API is a single commit, the diff is
produced against the first parent of the specified commit.
Two commits separated by .. may be provided as the spec, e.g.,
3a8b42..9ff173. When two commits are provided and the topic query
parameter is true, this API produces a 2-way three dot diff.
This is the diff between source commit and the merge base of the source
commit and the destination commit. When the topic query param is false,
a simple git-style diff is produced.
The two commits are interpreted as follows:
git diff.| Name | In | Required | Type | Description |
|---|---|---|---|---|
| ignore_whitespace | query | optional | boolean | Generate diffs that ignore whitespace |
| merge | query | optional | boolean | This parameter is deprecated. The ‘topic’ parameter should be used If true, the source commit is merged into the |
| path | query | optional | string | Limit the diffstat to a particular file (this parameter |
| renames | query | optional | boolean | Whether to perform rename detection, true if omitted. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| spec | path | required | string | A commit SHA (e.g. |
| topic | query | optional | boolean | If true, returns 2-way ‘three-dot’ diff. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The diff stats
If generating the diffstat timed out.
GET /repositories/{workspace}/{repo_slug}/diffstat/{spec}
/repositories/{workspace}/{repo_slug}/merge-base/{revspec}
Returns the best common ancestor between two commits, specified in a revspec
of 2 commits (e.g. 3a8b42..9ff173).
If more than one best common ancestor exists, only one will be returned. It is
unspecified which will be returned.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| revspec | path | required | string | A commit range using double dot notation (e.g. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The merge base of the provided spec.
If the request was not authenticated.
If the authenticated user does not have access to any of the repositories specified.
If the repository or ref in the spec does not exist.
GET /repositories/{workspace}/{repo_slug}/merge-base/{revspec}
/repositories/{workspace}/{repo_slug}/patch/{spec}
Produces a raw patch for a single commit (diffed against its first
parent), or a patch-series for a revspec of 2 commits (e.g.
3a8b42..9ff173 where the first commit represents the source and the
second commit the destination).
In case of the latter (diffing a revspec), a patch series is returned
for the commits on the source branch (3a8b42 and its ancestors in
our example).
While similar to diffs, patches:
path=foo/bar.py query parameterThe raw patch is returned as-is, in whatever encoding the files in the
repository use. It is not decoded into unicode. As such, the
content-type is text/plain.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| spec | path | required | string | A commit SHA (e.g. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The raw patches
If the diff was too large and timed out.
Since this endpoint does not employ any form of pagination, but
instead returns the diff as a single document, it can run into
trouble on very large diffs. If Bitbucket times out in cases
like these, a 555 status code is returned.
GET /repositories/{workspace}/{repo_slug}/patch/{spec}
/repositories/{workspace}/{repo_slug}/deploy-keys
Returns all deploy-keys belonging to a repository.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Deploy keys matching the repository
If the specified user or repository is not accessible to the current user
If the specified user or repository does not exist
GET /repositories/{workspace}/{repo_slug}/deploy-keys
/repositories/{workspace}/{repo_slug}/deploy-keys
Create a new deploy key in a repository. Note: If authenticating a deploy key
with an OAuth consumer, any changes to the OAuth consumer will subsequently
invalidate the deploy key.
Example:
$ curl -X POST \
-H "Authorization <auth header>" \
-H "Content-type: application/json" \
https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys -d \
'{
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8",
"label": "mydeploykey"
}'
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The deploy key that was created
Invalid deploy key inputs
If the specified user or repository is not accessible to the current user
If the specified user or repository does not exist
POST /repositories/{workspace}/{repo_slug}/deploy-keys
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
This deletes a deploy key from a repository.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The key has been deleted
If the current user does not have permission to delete a key for the specified user
If the specified user, repository, or deploy key does not exist
DELETE /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
Returns the deploy key belonging to a specific key.
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Deploy key matching the key ID
If the specified user or repository is not accessible to the current user
If the specified user or repository does not exist
GET /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
/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",
}'
| 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, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The newly updated deploy key.
If the submitted key or related value is invalid
If the current user does not have permission to add a key for the specified user
If the specified user, repository, or deploy key does not exist
PUT /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
/repositories/{workspace}/{repo_slug}/deployments
Find deployments
| 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 |
| repo_slug | path | required | string | The repository. |
The matching deployments.
GET /repositories/{workspace}/{repo_slug}/deployments
/repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid}
Retrieve a deployment
| 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 |
| repo_slug | path | required | string | The repository. |
| deployment_uuid | path | required | string | The deployment UUID. |
The deployment.
No account, repository or deployment with the UUID provided exists.
GET /repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid}
/repositories/{workspace}/{repo_slug}/environments
Find environments
| 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 |
| repo_slug | path | required | string | The repository. |
The matching environments.
GET /repositories/{workspace}/{repo_slug}/environments
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."
}
]
}
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"
}
]
}
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"
}
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"
}
ReportsBulkCreateOrUpdateAnnotationsRequest
{
"type": "array",
"items": {
"$ref": "#/components/schemas/report_annotation"
},
"maxItems": 100,
"minItems": 1
}
ReportsBulkCreateOrUpdateAnnotationsResponse
{
"type": "array",
"items": {
"$ref": "#/components/schemas/report_annotation"
}
}
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
}
]
}
account_links
{
"type": "object",
"title": "Account Links",
"properties": {
"avatar": {
"$ref": "#/components/schemas/link"
}
},
"description": "Links related to an Account.",
"additionalProperties": true
}
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
}
]
}
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
}
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
}
]
}
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
}
]
}
bitbucket.apps.permissions.serializers.ProjectPermissionUpdateSchema
{
"type": "object",
"required": [
"permission"
],
"properties": {
"permission": {
"enum": [
"read",
"write",
"create-repo",
"admin"
],
"type": "string"
}
}
}
bitbucket.apps.permissions.serializers.RepoPermissionUpdateSchema
{
"type": "object",
"required": [
"permission"
],
"properties": {
"permission": {
"enum": [
"read",
"write",
"admin"
],
"type": "string"
}
}
}
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
}
]
}
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
}
]
}
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
}
]
}
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
}
]
}
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
}
]
}
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
}
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
}
]
}
commit_comment
{
"allOf": [
{
"$ref": "#/components/schemas/comment"
},
{
"type": "object",
"title": "Commit Comment",
"properties": {
"commit": {
"$ref": "#/components/schemas/commit"
}
},
"description": "A commit comment.",
"additionalProperties": true
}
]
}
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
}
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
}
]
}
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
}
]
}
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"
]
}
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
}
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
}
]
}
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
}
]
}
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"
]
}
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.*"
]
}
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
}
]
}
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
}
]
}
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
}
]
}
deployment_state_completed_status
{
"allOf": [
{
"$ref": "#/components/schemas/object"
},
{
"type": "object",
"title": "Completed Deployment",
"properties": {},
"description": "The status of a completed deployment.",
"additionalProperties": true
}
]
}
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
}
]
}
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
}
]
}
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
}
]
}
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
}
]
}
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
}
]
}
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
}
]
}
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"
]
}
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.*"
]
}
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"
}
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"
]
}
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.*"
]
}
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"
}
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
}
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
}
]
}
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
}
| Version | Endpoints | Schemas | Ingested | Status |
|---|---|---|---|---|
| 2.0 | 318 | 216 | 2026-05-11 | current |
| 2.0 | 318 | 216 | 2026-04-16 |