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/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
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/{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/{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}/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}/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
/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/{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}
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}/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/{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}/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/{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}/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/{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}/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
/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}
Retrieve an environment
| 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. |
| environment_uuid | path | required | string | The environment UUID. |
The environment.
No account, repository or environment with the UUID provided exists.
GET /repositories/{workspace}/{repo_slug}/environments/{environment_uuid}
/workspaces/{workspace}/projects/{project_key}/deploy-keys
Returns all deploy keys belonging to a project.
| 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 |
Deploy keys matching the project
If the specified workspace or project is not accessible to the current user
If the specified workspace or project does not exist
GET /workspaces/{workspace}/projects/{project_key}/deploy-keys
/workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}
Returns the deploy key belonging to a specific key ID.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| key_id | path | required | string | The key ID matching the project deploy key. |
| 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 |
Project deploy key matching the key ID
If the specified workspace or project is not accessible to the current user
If the specified workspace or project does not exist
GET /workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}
/repositories/{workspace}/{repo_slug}/downloads
Returns a list of download links associated with 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 |
Returns a paginated list of the downloads associated with the repository.
User is not authorized to read from the repository.
GET /repositories/{workspace}/{repo_slug}/downloads
/repositories/{workspace}/{repo_slug}/downloads/{filename}
Return a redirect to the contents of a download artifact.
This endpoint returns the actual file contents and not the artifact’s
metadata.
$ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt
Hello World
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| filename | path | required | string | Name of the file. |
| 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 |
OK
Redirects to the url of the specified download artifact.
User is not authorized to read from the repository.
The specified download artifact does not exist.
GET /repositories/{workspace}/{repo_slug}/downloads/{filename}
/repositories/{workspace}/{repo_slug}/components
Returns the components that have been defined in the issue tracker.
This resource is only available on repositories that have the issue
tracker enabled.
| 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 components that have been defined in the issue tracker.
The specified repository does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/components
/repositories/{workspace}/{repo_slug}/components/{component_id}
Returns the specified issue tracker component object.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| component_id | path | required | integer | The component’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 specified component object.
The specified repository or component does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/components/{component_id}
/repositories/{workspace}/{repo_slug}/issues
Returns the issues in the issue tracker.
| 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 the issues matching any filter criteria that were provided.
The specified repository does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/issues
/repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip
This endpoint is used to poll for the progress of an issue export
job and return the zip file after the job is complete.
As long as the job is running, this will return a 202 response
with in the response body a description of the current status.
After the job has been scheduled, but before it starts executing, the endpoint
returns a 202 response with status ACCEPTED.
Once it starts running, it is a 202 response with status STARTED and progress filled.
After it is finished, it becomes a 200 response with status SUCCESS or FAILURE.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_name | path | required | string | The name of the repo |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| task_id | path | required | string | The ID of the export task |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Export job accepted
The request wasn’t authenticated properly
When the authenticated user does not have admin permission on the repo
No export job has begun
GET /repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip
/repositories/{workspace}/{repo_slug}/issues/import
When using GET, this endpoint reports the status of the current import task.
After the job has been scheduled, but before it starts executing, the endpoint
returns a 202 response with status ACCEPTED.
Once it starts running, it is a 202 response with status STARTED and progress filled.
After it is finished, it becomes a 200 response with status SUCCESS or FAILURE.
| 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 |
Import job complete with either FAILURE or SUCCESS status
Import job started
The request wasn’t authenticated properly
When the authenticated user does not have admin permission on the repo
No export job has begun
GET /repositories/{workspace}/{repo_slug}/issues/import
/repositories/{workspace}/{repo_slug}/issues/{issue_id}
Returns the specified issue.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The issue object.
When the authenticated user isn’t authorized to access the issue.
The specified repository or issue does not exist or does not have the issue tracker enabled.
The specified issue is unavailable.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments
Returns all attachments for this issue.
This returns the files’ meta data. This does not return the files’
actual contents.
The files are always ordered by their upload date.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of all attachments for this issue.
If the issue tracker is private and the request was not authenticated.
The specified repository or issue does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}
Returns the contents of the specified file attachment.
Note that this endpoint does not return a JSON response, but instead
returns a redirect pointing to the actual file that in turn will return
the raw contents.
The redirect URL contains a one-time token that has a limited lifetime.
As a result, the link should not be persisted, stored, or shared.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| issue_id | path | required | string | The issue id |
| path | path | required | string | Path to the file. |
| 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 |
OK
A redirect to the file’s contents
If the issue tracker is private and the request was not authenticated.
The specified repository or issue does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes
Returns the list of all changes that have been made to the specified
issue. Changes are returned in chronological order with the oldest
change first.
Each time an issue is edited in the UI or through the API, an immutable
change record is created under the /issues/123/changes endpoint. It
also has a comment associated with the change.
Note that this operation is changing significantly, due to privacy changes.
See the announcement
for details.
Changes support filtering and sorting that
can be used to search for specific changes. For instance, to see
when an issue transitioned to “resolved”:
$ curl -s https://api.bitbucket.org/2.0/repositories/site/master/issues/1/changes \
-G --data-urlencode='q=changes.state.new = "resolved"'
This resource is only available on repositories that have the issue
tracker enabled.
N.B.
The changes.assignee and changes.assignee_account_id fields are not
a user object. Instead, they contain the raw username and
account_id of the user. This is to protect the integrity of the audit
log even after a user account gets deleted.
The changes.assignee field is deprecated will disappear in the
future. Use changes.assignee_account_id instead.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| 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. See |
| sort | query | optional | string |
Name of a response property to sort results. See |
Returns all the issue changes that were made on the specified issue.
The specified repository or issue does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes/{change_id}
Returns the specified issue change object.
This resource is only available on repositories that have the issue
tracker enabled.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| change_id | path | required | string | The issue change id |
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified issue change object.
The specified repository or issue change does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes/{change_id}
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments
Returns a paginated list of all comments that were made on the
specified issue.
The default sorting is oldest to newest and can be overridden with
the sort query parameter.
This endpoint also supports filtering and sorting of the results. See
filtering and sorting for more details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| 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 |
A paginated list of issue comments.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
Returns the specified issue comment object.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| comment_id | path | required | integer | The id of the comment. |
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The issue comment.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
Check whether the authenticated user has voted for this issue.
A 204 status code indicates that the user has voted, while a 404
implies they haven’t.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
If the authenticated user has not voted for this issue.
When the request wasn’t authenticated.
If the authenticated user has not voted for this issue, or when the repo does not exist, or does not have an issue tracker.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
Indicated whether or not the authenticated user is watching this
issue.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| issue_id | path | required | string | The issue id |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
If the authenticated user is watching this issue.
When the request wasn’t authenticated.
If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.
GET /repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
/repositories/{workspace}/{repo_slug}/milestones
Returns the milestones that have been defined in the issue tracker.
This resource is only available on repositories that have the issue
tracker enabled.
| 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 milestones that have been defined in the issue tracker.
The specified repository does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/milestones
/repositories/{workspace}/{repo_slug}/milestones/{milestone_id}
Returns the specified issue tracker milestone object.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| milestone_id | path | required | integer | The milestone’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 specified milestone object.
The specified repository or milestone does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/milestones/{milestone_id}
/repositories/{workspace}/{repo_slug}/versions
Returns the versions that have been defined in the issue tracker.
This resource is only available on repositories that have the issue
tracker enabled.
| 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 versions that have been defined in the issue tracker.
The specified repository does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/versions
/repositories/{workspace}/{repo_slug}/versions/{version_id}
Returns the specified issue tracker version object.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| version_id | path | required | integer | The version’s id |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified version object.
The specified repository or version does not exist or does not have the issue tracker enabled.
GET /repositories/{workspace}/{repo_slug}/versions/{version_id}
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
Find deployment environment level variables.
| 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. |
| environment_uuid | path | required | string | The environment. |
The retrieved deployment variables.
GET /repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
/repositories/{workspace}/{repo_slug}/pipelines
Find pipelines
| 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 pipelines.
GET /repositories/{workspace}/{repo_slug}/pipelines
/repositories/{workspace}/{repo_slug}/pipelines-config/caches
Retrieve the repository pipelines caches.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
The list of caches for the given repository.
The account or repository was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines-config/caches
/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri
Retrieve the URI of the content of the specified cache.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
| cache_uuid | path | required | string | The UUID of the cache. |
The cache content uri.
The workspace, repository or cache_uuid with given UUID was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
Retrieve a specified pipeline
| 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. |
| pipeline_uuid | path | required | string | The pipeline UUID. |
The pipeline.
No account, repository or pipeline with the UUID provided exists.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps
Find steps for the given pipeline.
| 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. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
The steps.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}
Retrieve a given step of a pipeline.
| 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. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
The step.
No account, repository, pipeline or step with the UUID provided exists for the pipeline with the UUID provided.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log
Retrieve the log file for a given step of a pipeline.
This endpoint supports (and encourages!) the use of HTTP Range requests to deal with potentially very large log files.
| 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. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
The raw log file for this pipeline step.
The log has the same etag as the provided If-None-Match header.
A pipeline with the given UUID does not exist, a step with the given UUID does not exist in the pipeline or a log file does not exist for the given step.
The requested range does not exist for requests that specified the HTTP Range header.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}
Retrieve the log file for a build container or service container.
This endpoint supports (and encourages!) the use of HTTP Range requests to deal with potentially very large log files.
| 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. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
| log_uuid | path | required | string | For the main build container specify the step UUID; for a service container specify the service container UUID |
The raw log file for the build container or service container.
No account, repository, pipeline, step or log exist for the provided path.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports
| 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. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
A summary of test reports for this pipeline step.
No account, repository, pipeline, step or test reports exist for the provided path.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases
| 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. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
Test cases for this pipeline step.
No account, repository, pipeline, step or test reports exist for the provided path.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons
| 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. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
| test_case_uuid | path | required | string | The UUID of the test case. |
Test case reasons (output).
No account, repository, pipeline, step or test case with the UUID provided exists for the pipeline with the UUID provided.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons
/repositories/{workspace}/{repo_slug}/pipelines_config
Retrieve the repository pipelines configuration.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
The repository pipelines configuration.
GET /repositories/{workspace}/{repo_slug}/pipelines_config
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
Retrieve the configured schedules for the given repository.
| 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 list of schedules.
The account or repository was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/schedules
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
Retrieve a schedule by its UUID.
| 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. |
| schedule_uuid | path | required | string | The uuid of the schedule. |
The requested schedule.
The account, repository or schedule was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions
Retrieve the executions of a given schedule.
| 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. |
| schedule_uuid | path | required | string | The uuid of the schedule. |
The list of executions of a schedule.
The account or repository was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
Retrieve the repository SSH key pair excluding the SSH private key. The private key is a write only field and will never be exposed in the logs or the REST API.
| 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 SSH key pair.
The account, repository or SSH key pair was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
Find repository level known hosts.
| 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 retrieved known hosts.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
Retrieve a repository level known host.
| 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. |
| known_host_uuid | path | required | string | The UUID of the known host to retrieve. |
The known host.
The account, repository or known host with the specified UUID was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/variables
Find repository level variables.
| 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 retrieved variables.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/variables
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
Retrieve a repository level variable.
| 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. |
| variable_uuid | path | required | string | The UUID of the variable to retrieve. |
The variable.
The account, repository or variable with the specified UUID was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/
| 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 |
The OpenID configuration
The workspace was not found.
GET /workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
/workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/
| 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 |
The keys in JSON web key format
The workspace was not found.
GET /workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
/workspaces/{workspace}/pipelines-config/variables
Find workspace level variables.
| 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 |
The found workspace level variables.
GET /workspaces/{workspace}/pipelines-config/variables
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
Retrieve a workspace level variable.
| 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 |
| variable_uuid | path | required | string | The UUID of the variable to retrieve. |
The variable.
The workspace or variable with the given UUID was not found.
GET /workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
/workspaces/{workspace}/projects/{project_key}
Returns the requested project.
| 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 project that is part of a workspace.
The request wasn’t authenticated.
The requesting user isn’t authorized to access the project.
A project isn’t hosted at this location.
GET /workspaces/{workspace}/projects/{project_key}
/workspaces/{workspace}/projects/{project_key}/default-reviewers
Return a list of all default reviewers for a project. This is a list of users that will be added as default
reviewers to pull requests for any repository within the project.
| 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 list of project default reviewers
If the authenticated user does not have admin access to the project
If the workspace or project does not exist at this location
GET /workspaces/{workspace}/projects/{project_key}/default-reviewers
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
Returns the specified default reviewer.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This can either be the actual |
| selected_user | path | required | string | This can either be the username or the UUID of the default reviewer, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified user that is a default reviewer
If the specified user is not a default reviewer for the project
If the authenticated user does not have admin access to the project
If the specified user, project, or workspace does not exist
GET /workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups
Returns a paginated list of explicit group permissions for the given project.
This endpoint does not support BBQL features.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual key assigned to the project. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Paginated list of project group permissions
The user couldn’t be authenticated.
The user doesn’t have admin access to the project.
One or both of the workspace and project don’t exist for the given identifiers or the requesting user is not authenticated
GET /workspaces/{workspace}/projects/{project_key}/permissions-config/groups
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
Returns the group permission for a given group and project.
Only users with admin permission for the project may access this resource.
Permissions can be:
admincreate-repowritereadnone| Name | In | Required | Type | Description |
|---|---|---|---|---|
| group_slug | path | required | string | Slug of the requested group. |
| project_key | path | required | string | The project in question. This is the actual key assigned to the project. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Project group permission
The user couldn’t be authenticated.
The user doesn’t have admin access to the project.
One or more of the workspace, project, and group doesn’t exist for the given identifiers or the requesting user is not authenticated
GET /workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
/workspaces/{workspace}/projects/{project_key}/permissions-config/users
Returns a paginated list of explicit user permissions for the given project.
This endpoint does not support BBQL features.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual key assigned to the project. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Paginated list of explicit user permissions.
The user couldn’t be authenticated.
The user doesn’t have admin access to the project.
One or both of the workspace and project don’t exist for the given identifiers or the requesting user is not authenticated
GET /workspaces/{workspace}/projects/{project_key}/permissions-config/users
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
Returns the explicit user permission for a given user and project.
Only users with admin permission for the project may access this resource.
Permissions can be:
admincreate-repowritereadnone| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual key assigned to the project. |
| selected_user_id | path | required | string | This can either be the username, the user’s UUID surrounded by curly-braces, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Explicit user permission for user and project
The user couldn’t be authenticated.
The requesting user isn’t an admin of the project.
One or more of the workspace, project, and selected user doesn’t exist for the given identifiers or the requesting user is not authenticated
GET /workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
Retrieve an application property value stored against a commit.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The repository container; either the workspace slug or the UUID in curly braces. |
| repo_slug | path | required | string | The repository. |
| commit | path | required | string | The commit. |
| app_key | path | required | string | The key of the Connect app. |
| property_name | path | required | string | The name of the property. |
The value of the property.
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
Retrieve an application property value stored against a repository.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The repository container; either the workspace slug or the UUID in curly braces. |
| repo_slug | path | required | string | The repository. |
| app_key | path | required | string | The key of the Connect app. |
| property_name | path | required | string | The name of the property. |
The value of the property.
GET /repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
Retrieve an application property value stored against a pull request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The repository container; either the workspace slug or the UUID in curly braces. |
| repo_slug | path | required | string | The repository. |
| pullrequest_id | path | required | string | The pull request ID. |
| app_key | path | required | string | The key of the Connect app. |
| property_name | path | required | string | The name of the property. |
The value of the property.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
/users/{selected_user}/properties/{app_key}/{property_name}
Retrieve an application property value stored against a user.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| selected_user | path | required | string | Either the UUID of the account surrounded by curly-braces, for example |
| app_key | path | required | string | The key of the Connect app. |
| property_name | path | required | string | The name of the property. |
The value of the property.
GET /users/{selected_user}/properties/{app_key}/{property_name}
/pullrequests/{selected_user}
Returns all pull requests authored by the specified user.
By default only open pull requests are returned. This can be controlled
using the state query parameter. To retrieve pull requests that are
in one of multiple states, repeat the state parameter for each
individual state.
This endpoint also supports filtering and sorting of the results. See
filtering and sorting for more details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| selected_user | path | required | string | This can either be the username of the pull request author, the author’s UUID |
| state | query | optional | string | Only return pull requests that are in this state. This parameter can be repeated. |
All pull requests authored by the specified user.
If the specified user does not exist.
GET /pullrequests/{selected_user}
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses
Returns all statuses (e.g. build results) for the given pull
request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| 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 pull request.
If the repository is private and the request was not authenticated.
If the specified repository or pull request does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses
/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests
Returns a paginated list of all pull requests as part of which this commit was reviewed. Pull Request Commit Links app must be installed first before using this API; installation automatically occurs when ‘Go to pull request’ is clicked from the web interface for a commit’s details.
| 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 |
| repo_slug | path | required | string | The repository; either the UUID in curly braces, or the slug |
| commit | path | required | string | The SHA1 of the commit |
| page | query | optional | integer | Which page to retrieve |
| pagelen | query | optional | integer | How many pull requests to retrieve per page |
The paginated list of pull requests.
The repository’s pull requests are still being indexed.
Either the repository does not exist, or pull request commit links have not yet been indexed.
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests
/repositories/{workspace}/{repo_slug}/default-reviewers
Returns the repository’s default reviewers.
These are the users that are automatically added as reviewers on every
new pull request that is created. To obtain the repository’s default reviewers
as well as the default reviewers inherited from the project, use the
effective-default-reveiwers endpoint.
| 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 paginated list of default reviewers
If the authenticated user does not have access to view the default reviewers
GET /repositories/{workspace}/{repo_slug}/default-reviewers
/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
Returns the specified reviewer.
This can be used to test whether a user is among the repository’s
default reviewers list. A 404 indicates that that specified user is not
a default reviewer.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| target_username | path | required | string | This can either be the username or the UUID of the default reviewer, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified user is a default reviewer
If the authenticated user does not have access to check if the specified user is a default reviewer
If the specified user does not exist or is not a default reviewer
GET /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
/repositories/{workspace}/{repo_slug}/effective-default-reviewers
Returns the repository’s effective default reviewers. This includes both default
reviewers defined at the repository level as well as those inherited from its project.
These are the users that are automatically added as reviewers on every
new pull request that is created.
| 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 paginated list of effective default reviewers
If the authenticated user does not have access to view the default reviewers
GET /repositories/{workspace}/{repo_slug}/effective-default-reviewers
/repositories/{workspace}/{repo_slug}/pullrequests
Returns all pull requests on the specified repository.
By default only open pull requests are returned. This can be controlled
using the state query parameter. To retrieve pull requests that are
in one of multiple states, repeat the state parameter for each
individual state.
This endpoint also supports filtering and sorting of the results. See
filtering and sorting for more details.
| 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 |
| state | query | optional | string | Only return pull requests that are in this state. This parameter can be repeated. |
All pull requests on the specified repository.
If the repository is private and the request was not authenticated.
If the specified repository does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests
/repositories/{workspace}/{repo_slug}/pullrequests/activity
Returns a paginated list of the pull request’s activity log.
This handler serves both a v20 and internal endpoint. The v20 endpoint
returns reviewer comments, updates, approvals and request changes. The internal
endpoint includes those plus tasks and attachments.
Comments created on a file or a line of code have an inline property.
Comment example:
{
"pagelen": 20,
"values": [
{
"comment": {
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088"
}
},
"deleted": false,
"pullrequest": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
},
"content": {
"raw": "inline with to a dn from lines",
"markup": "markdown",
"html": "<p>inline with to a dn from lines</p>",
"type": "rendered"
},
"created_on": "2019-09-27T00:33:46.039178+00:00",
"user": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
},
"created_on": "2019-09-27T00:33:46.039178+00:00",
"user": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
},
"updated_on": "2019-09-27T00:33:46.055384+00:00",
"inline": {
"context_lines": "",
"to": null,
"path": "",
"outdated": false,
"from": 211
},
"type": "pullrequest_comment",
"id": 118571088
},
"pull_request": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
}
}
]
}
Updates include a state property of OPEN, MERGED, or DECLINED.
Update example:
{
"pagelen": 20,
"values": [
{
"update": {
"description": "",
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it",
"destination": {
"commit": {
"type": "commit",
"hash": "6a2c16e4a152",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152"
}
}
},
"branch": {
"name": "master"
},
"repository": {
"name": "Atlaskit-MK-2",
"type": "repository",
"full_name": "atlassian/atlaskit-mk-2",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/%7B%7D?ts=js"
}
},
"uuid": "{}"
}
},
"reason": "",
"source": {
"commit": {
"type": "commit",
"hash": "728c8bad1813",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813"
}
}
},
"branch": {
"name": "username/NONE-add-onClick-prop-for-accessibility"
},
"repository": {
"name": "Atlaskit-MK-2",
"type": "repository",
"full_name": "atlassian/atlaskit-mk-2",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/%7B%7D?ts=js"
}
},
"uuid": "{}"
}
},
"state": "OPEN",
"author": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
},
"date": "2019-05-10T06:48:25.305565+00:00"
},
"pull_request": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
}
}
]
}
Approval example:
{
"pagelen": 20,
"values": [
{
"approval": {
"date": "2019-09-27T00:37:19.849534+00:00",
"pullrequest": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
},
"user": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
}
},
"pull_request": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
}
}
]
}
| 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 pull request activity log
If the repository is private and the request was not authenticated.
If the specified repository does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests/activity
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
Returns the specified pull request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The pull request object
If the repository is private and the request was not authenticated.
If the repository or pull request does not exist
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity
Returns a paginated list of the pull request’s activity log.
This handler serves both a v20 and internal endpoint. The v20 endpoint
returns reviewer comments, updates, approvals and request changes. The internal
endpoint includes those plus tasks and attachments.
Comments created on a file or a line of code have an inline property.
Comment example:
{
"pagelen": 20,
"values": [
{
"comment": {
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088"
}
},
"deleted": false,
"pullrequest": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
},
"content": {
"raw": "inline with to a dn from lines",
"markup": "markdown",
"html": "<p>inline with to a dn from lines</p>",
"type": "rendered"
},
"created_on": "2019-09-27T00:33:46.039178+00:00",
"user": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
},
"created_on": "2019-09-27T00:33:46.039178+00:00",
"user": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
},
"updated_on": "2019-09-27T00:33:46.055384+00:00",
"inline": {
"context_lines": "",
"to": null,
"path": "",
"outdated": false,
"from": 211
},
"type": "pullrequest_comment",
"id": 118571088
},
"pull_request": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
}
}
]
}
Updates include a state property of OPEN, MERGED, or DECLINED.
Update example:
{
"pagelen": 20,
"values": [
{
"update": {
"description": "",
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it",
"destination": {
"commit": {
"type": "commit",
"hash": "6a2c16e4a152",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152"
}
}
},
"branch": {
"name": "master"
},
"repository": {
"name": "Atlaskit-MK-2",
"type": "repository",
"full_name": "atlassian/atlaskit-mk-2",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/%7B%7D?ts=js"
}
},
"uuid": "{}"
}
},
"reason": "",
"source": {
"commit": {
"type": "commit",
"hash": "728c8bad1813",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813"
}
}
},
"branch": {
"name": "username/NONE-add-onClick-prop-for-accessibility"
},
"repository": {
"name": "Atlaskit-MK-2",
"type": "repository",
"full_name": "atlassian/atlaskit-mk-2",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/%7B%7D?ts=js"
}
},
"uuid": "{}"
}
},
"state": "OPEN",
"author": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
},
"date": "2019-05-10T06:48:25.305565+00:00"
},
"pull_request": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
}
}
]
}
Approval example:
{
"pagelen": 20,
"values": [
{
"approval": {
"date": "2019-09-27T00:37:19.849534+00:00",
"pullrequest": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
},
"user": {
"display_name": "Name Lastname",
"uuid": "{}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B%7D"
},
"html": {
"href": "https://bitbucket.org/%7B%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128"
}
},
"type": "user",
"nickname": "Name",
"account_id": ""
}
},
"pull_request": {
"type": "pullrequest",
"id": 5695,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695"
},
"html": {
"href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695"
}
},
"title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it"
}
}
]
}
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The pull request activity log
If the repository is private and the request was not authenticated.
If the specified repository does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments
Returns a paginated list of the pull request’s comments.
This includes both global, inline comments and replies.
The default sorting is oldest to newest and can be overridden with
the sort query parameter.
This endpoint also supports filtering and sorting of the results. See
filtering and sorting for more
details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of comments made on the given pull request, in chronological order.
If the authenticated user does not have access to the pull request.
If the pull request does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
Returns a specific pull request comment.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| comment_id | path | required | integer | The id of the comment. |
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The comment.
If the authenticated user does not have access to the pull request.
If the comment does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits
Returns a paginated list of the pull request’s commits.
These are the commits that are being merged into the destination
branch when the pull requests gets accepted.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of commits made on the given pull request, in chronological order. This list will be empty if the source branch no longer exists.
If the authenticated user does not have access to the pull request.
If the pull request does not exist or the source branch is from a forked repository which no longer exists.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff
Redirects to the repository diff
with the revspec that corresponds to the pull request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Redirects to the repository diff with the
revspec that corresponds to the pull request.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat
Redirects to the repository diffstat
with the revspec that corresponds to the pull request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Redirects to the repository diffstat with
the revspec that corresponds to pull request.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}
When merging a pull request takes too long, the client receives a
task ID along with a 202 status code. The task ID can be used in a call
to this endpoint to check the status of a merge task.
curl -X GET https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/<task_id>
If the merge task is not yet finished, a PENDING status will be returned.
HTTP/2 200
{
"task_status": "PENDING",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/<task_id>"
}
}
}
If the merge was successful, a SUCCESS status will be returned.
HTTP/2 200
{
"task_status": "SUCCESS",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/<task_id>"
}
},
"merge_result": <the merged pull request object>
}
If the merge task failed, an error will be returned.
{
"type": "error",
"error": {
"message": "<error message>"
}
}
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| task_id | path | required | string | ID of the merge task |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Returns a task status if the merge is either pending or successful, and if it is successful, a pull request
If the provided task ID does not relate to this pull request, or if something went wrong during the merge operation
The user making the request does not have permission to the repo and is different from the user who queued the task
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch
Redirects to the repository patch
with the revspec that corresponds to pull request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Redirects to the repository patch with
the revspec that corresponds to pull request.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
Returns a paginated list of the pull request’s tasks.
This endpoint supports filtering and sorting of the results by the ‘task’ field.
See filtering and sorting for more details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| 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. See |
| sort | query | optional | string |
Field by which the results should be sorted as per |
| pagelen | query | optional | integer |
Current number of objects on the existing page. |
A paginated list of pull request tasks for the given pull request.
If the user provides an invalid filter, sort, or fields query parameter.
If the authenticated user does not have access to the pull request.
If the pull request does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
Returns a specific pull request task.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pull_request_id | path | required | integer | The id of the pull request. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| task_id | path | required | integer | The ID of the task. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The task.
If the authenticated user does not have access to the pull request.
If the task does not exist.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
/repositories/{workspace}/{repo_slug}/refs
Returns the branches and tags in the repository.
By default, results will be in the order the underlying source control system returns them and identical to
the ordering one sees when running “$ git show-ref”. Note that this follows simple
lexical ordering of the ref names.
This can be undesirable as it does apply any natural sorting semantics, meaning for instance that refs are
sorted [“branch1”, “branch10”, “branch2”, “v10”, “v11”, “v9”] instead of [“branch1”, “branch2”,
“branch10”, “v9”, “v10”, “v11”].
Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name,
Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.
| 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 |
| 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 refs matching any filter criteria that were provided.
If the repository is private and the authenticated user does not have
access to it.
The specified repository does not exist.
GET /repositories/{workspace}/{repo_slug}/refs
/repositories/{workspace}/{repo_slug}/refs/branches
Returns a list of all open branches within the specified repository.
Results will be in the order the source control manager returns them.
Branches support filtering and sorting
that can be used to search for specific branches. For instance, to find
all branches that have “stab” in their name:
curl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches -G --data-urlencode 'q=name ~ "stab"'
By default, results will be in the order the underlying source control system returns them and identical to
the ordering one sees when running “$ git branch –list”. Note that this follows simple
lexical ordering of the ref names.
This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are
sorted [“v10”, “v11”, “v9”] instead of [“v9”, “v10”, “v11”].
Sorting can be changed using the ?q= query parameter. When using ?q=name to explicitly sort on ref name,
Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.
| 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 |
| 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 branches matching any filter criteria that were provided.
If the repository is private and the authenticated user does not have
access to it.
The specified repository does not exist.
GET /repositories/{workspace}/{repo_slug}/refs/branches
/repositories/{workspace}/{repo_slug}/refs/branches/{name}
Returns a branch object within the specified repository.
This call requires authentication. Private repositories require the
caller to authenticate with an account that has appropriate
authorization.
For Git, the branch name should not include any prefixes (e.g.
refs/heads).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| name | path | required | string | The name of the branch. |
| 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 object.
If the repository is private and the authenticated user does not have
access to it.
The specified repository or branch does not exist.
GET /repositories/{workspace}/{repo_slug}/refs/branches/{name}
/repositories/{workspace}/{repo_slug}/refs/tags
Returns the tags in the repository.
By default, results will be in the order the underlying source control system returns them and identical to
the ordering one sees when running “$ git tag –list”. Note that this follows simple
lexical ordering of the ref names.
This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are
sorted [“v10”, “v11”, “v9”] instead of [“v9”, “v10”, “v11”].
Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name,
Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.
| 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 |
| 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 tags matching any filter criteria that were provided.
If the repository is private and the authenticated user does not have
access to it.
The specified repository does not exist.
GET /repositories/{workspace}/{repo_slug}/refs/tags
/repositories/{workspace}/{repo_slug}/refs/tags/{name}
Returns the specified tag.
$ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq .
{
"name": "3.8",
"links": {
"commits": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commits/3.8"
},
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8"
},
"html": {
"href": "https://bitbucket.org/seanfarley/hg/commits/tag/3.8"
}
},
"tagger": {
"raw": "Matt Mackall <mpm@selenic.com>",
"type": "author",
"user": {
"username": "mpmselenic",
"nickname": "mpmselenic",
"display_name": "Matt Mackall",
"type": "user",
"uuid": "{a4934530-db4c-419c-a478-9ab4964c2ee7}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/mpmselenic"
},
"html": {
"href": "https://bitbucket.org/mpmselenic/"
},
"avatar": {
"href": "https://bitbucket.org/account/mpmselenic/avatar/32/"
}
}
}
},
"date": "2016-05-01T18:52:25+00:00",
"message": "Added tag 3.8 for changeset f85de28eae32",
"type": "tag",
"target": {
"hash": "f85de28eae32e7d3064b1a1321309071bbaaa069",
"repository": {
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg"
},
"html": {
"href": "https://bitbucket.org/seanfarley/hg"
},
"avatar": {
"href": "https://bitbucket.org/seanfarley/hg/avatar/32/"
}
},
"type": "repository",
"name": "hg",
"full_name": "seanfarley/hg",
"uuid": "{c75687fb-e99d-4579-9087-190dbd406d30}"
},
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069"
},
"comments": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/comments"
},
"patch": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/patch/f85de28eae32e7d3064b1a1321309071bbaaa069"
},
"html": {
"href": "https://bitbucket.org/seanfarley/hg/commits/f85de28eae32e7d3064b1a1321309071bbaaa069"
},
"diff": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/diff/f85de28eae32e7d3064b1a1321309071bbaaa069"
},
"approve": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/approve"
},
"statuses": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/statuses"
}
},
"author": {
"raw": "Sean Farley <sean@farley.io>",
"type": "author",
"user": {
"username": "seanfarley",
"nickname": "seanfarley",
"display_name": "Sean Farley",
"type": "user",
"uuid": "{a295f8a8-5876-4d43-89b5-3ad8c6c3c51d}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/seanfarley"
},
"html": {
"href": "https://bitbucket.org/seanfarley/"
},
"avatar": {
"href": "https://bitbucket.org/account/seanfarley/avatar/32/"
}
}
}
},
"parents": [
{
"hash": "9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2",
"type": "commit",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2"
},
"html": {
"href": "https://bitbucket.org/seanfarley/hg/commits/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2"
}
}
}
],
"date": "2016-05-01T04:21:17+00:00",
"message": "debian: alphabetize build deps",
"type": "commit"
}
}
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| name | path | required | string | The name of the tag. |
| 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 tag object.
If the repository is private and the authenticated user does not have
access to it.
The specified repository or tag does not exist.
GET /repositories/{workspace}/{repo_slug}/refs/tags/{name}
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports
Returns a paginated list of Reports linked to this commit.
| 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. |
| commit | path | required | string | The commit for which to retrieve reports. |
OK
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
Returns a single Report matching the provided ID.
| 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. |
| commit | path | required | string | The commit the report belongs to. |
| reportId | path | required | string | Either the uuid or external-id of the report. |
OK
The report with the given ID was not found.
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
Returns a paginated list of Annotations for a specified report.
| 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. |
| commit | path | required | string | The commit for which to retrieve reports. |
| reportId | path | required | string | Uuid or external-if of the report for which to get annotations for. |
OK
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
Returns a single Annotation matching the provided ID.
| 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. |
| commit | path | required | string | The commit the report belongs to. |
| reportId | path | required | string | Either the uuid or external-id of the report. |
| annotationId | path | required | string | Either the uuid or external-id of the annotation. |
OK
The annotation with the given ID was not found.
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
/repositories
Returns a paginated list of all public repositories.
This endpoint also supports filtering and sorting of the results. See
filtering and sorting for more details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| after | query | optional | string | Filter the results to include only repositories created on or |
| role | query | optional | string | Filters the result based on the authenticated user’s role on each repository.
|
| q | query | optional | string | Query string to narrow down the response as per filtering and sorting. |
| sort | query | optional | string | Field by which the results should be sorted as per filtering and sorting. |
All public repositories.
GET /repositories
/repositories/{workspace}
Returns a paginated list of all repositories owned by the specified
workspace.
The result can be narrowed down based on the authenticated user’s role.
E.g. with ?role=contributor, only those repositories that the
authenticated user has write access to are returned (this includes any
repo the user is an admin on, as that implies write access).
This endpoint also supports filtering and sorting of the results. See
filtering and sorting for more details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
| role | query | optional | string |
Filters the result based on the authenticated user’s role on each repository.
|
| q | query | optional | string |
Query string to narrow down the response as per filtering and sorting. |
| sort | query | optional | string |
Field by which the results should be sorted as per filtering and sorting. |
The repositories owned by the specified account.
If the specified account does not exist.
If the specified account marked as spam.
GET /repositories/{workspace}
/repositories/{workspace}/{repo_slug}
Returns the object describing this 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 |
The repository object.
If the repository is private and the authenticated user does not have access to it.
If no repository exists at this location.
GET /repositories/{workspace}/{repo_slug}
/repositories/{workspace}/{repo_slug}/forks
Returns a paginated list of all the forks of the specified
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 |
| role | query | optional | string | Filters the result based on the authenticated user’s role on each repository.
|
| q | query | optional | string | Query string to narrow down the response as per filtering and sorting. |
| sort | query | optional | string | Field by which the results should be sorted as per filtering and sorting. |
All forks.
GET /repositories/{workspace}/{repo_slug}/forks
/repositories/{workspace}/{repo_slug}/override-settings
| 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 repository setting inheritance state
If no repository exists at this location
GET /repositories/{workspace}/{repo_slug}/override-settings
/repositories/{workspace}/{repo_slug}/permissions-config/groups
Returns a paginated list of explicit group permissions for the given repository.
This endpoint does not support BBQL features.
| 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 |
Paginated of explicit group permissions on the repository.
The user couldn’t be authenticated.
The requesting user isn’t an admin of the repository.
One or both of the workspace and repository doesn’t exist for the given identifiers.
GET /repositories/{workspace}/{repo_slug}/permissions-config/groups
/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
Returns the group permission for a given group slug and repository
Only users with admin permission for the repository may access this resource.
Permissions can be:
adminwritereadnone| Name | In | Required | Type | Description |
|---|---|---|---|---|
| group_slug | path | required | string | Slug of the requested group. |
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Group permission for group slug and repository
The user couldn’t be authenticated.
The requesting user isn’t an admin of the repository.
The given user, workspace, and/or repository could not be found
GET /repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
/repositories/{workspace}/{repo_slug}/permissions-config/users
Returns a paginated list of explicit user permissions for the given repository.
This endpoint does not support BBQL features.
| 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 |
Paginated of explicit user permissions on the repository.
The user couldn’t be authenticated.
The requesting user isn’t an admin of the repository.
No repository exists for the given repository slug and workspace.
GET /repositories/{workspace}/{repo_slug}/permissions-config/users
/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
Returns the explicit user permission for a given user and repository.
Only users with admin permission for the repository may access this resource.
Permissions can be:
adminwritereadnone| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| selected_user_id | path | required | string | This can either be the UUID of the account, surrounded by curly-braces, for |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Explicit user permission for user and repository
The user couldn’t be authenticated.
The requesting user isn’t an admin of the repository.
One or both of the workspace and repository doesn’t exist for the given identifiers.
GET /repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
/repositories/{workspace}/{repo_slug}/watchers
Returns a paginated list of all the watchers on the specified
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 |
A paginated list of all the watchers on the specified repository.
GET /repositories/{workspace}/{repo_slug}/watchers
/user/permissions/repositories
Returns an object for each repository the caller has explicit access
to and their effective permission — the highest level of permission the
caller has. This does not return public repositories that the user was
not granted any specific permission in, and does not distinguish between
explicit and implicit privileges.
Permissions can be:
adminwritereadResults may be further filtered or sorted by
repository or permission by adding the following query string
parameters:
q=repository.name="geordi" or q=permission>"read"sort=repository.nameNote that the query parameter values need to be URL escaped so that =
would become %3D.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| q | query | optional | string |
Query string to narrow down the response as per |
| sort | query | optional | string |
Name of a response property sort the result by as per |
Repository permissions for the repositories a caller has explicit access to.
GET /user/permissions/repositories
/repositories/{workspace}/{repo_slug}/hooks
Returns a paginated list of webhooks installed on this 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 |
The paginated list of installed webhooks.
If the authenticated user does not have permission to access the webhooks.
If the repository does not exist.
GET /repositories/{workspace}/{repo_slug}/hooks
/repositories/{workspace}/{repo_slug}/hooks/{uid}
Returns the webhook with the specified id installed on the specified
repository.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| uid | path | required | string | Installed webhook’s ID |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The webhook subscription object.
If the webhook or repository does not exist.
GET /repositories/{workspace}/{repo_slug}/hooks/{uid}
/teams/{username}/search/code
Search for code in the repositories of the specified team.
Note that searches can match in the file’s text (content_matches),
the path (path_matches), or both.
You can use the same syntax for the search query as in the UI.
E.g. to search for “foo” only within the repository “demo”,
use the query parameter search_query=foo+repo:demo.
Similar to other APIs, you can request more fields using a
fields query parameter. E.g. to get some more information about
the repository of matched files, use the query parameter
search_query=foo&fields=%2Bvalues.file.commit.repository
(the %2B is a URL-encoded +).
Try fields=%2Bvalues.*.*.*.* to get an idea what’s possible.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| username | path | required | string | The account to search in; either the username or the UUID in curly braces |
| search_query | query | required | string | The search query |
| page | query | optional | integer | Which page of the search results to retrieve |
| pagelen | query | optional | integer | How many search results to retrieve per page |
Successful search
If the search request was invalid due to one of the
following reasons:
the specified type of target account doesn’‘t match the actual
account type;
malformed pagination properties;
missing or malformed search query, in the latter case an error
key will be returned in error.data.key property.
Search is not enabled for the requested team, navigate to https://bitbucket.org/search to turn it on
Too many requests, try again later
GET /teams/{username}/search/code
/users/{selected_user}/search/code
Search for code in the repositories of the specified user.
Note that searches can match in the file’s text (content_matches),
the path (path_matches), or both.
You can use the same syntax for the search query as in the UI.
E.g. to search for “foo” only within the repository “demo”,
use the query parameter search_query=foo+repo:demo.
Similar to other APIs, you can request more fields using a
fields query parameter. E.g. to get some more information about
the repository of matched files, use the query parameter
search_query=foo&fields=%2Bvalues.file.commit.repository
(the %2B is a URL-encoded +).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| selected_user | path | required | string | Either the UUID of the account surrounded by curly-braces, for example |
| search_query | query | required | string | The search query |
| page | query | optional | integer | Which page of the search results to retrieve |
| pagelen | query | optional | integer | How many search results to retrieve per page |
Successful search
If the search request was invalid due to one of the
following reasons:
the specified type of target account doesn’‘t match the actual
account type;
malformed pagination properties;
missing or malformed search query, in the latter case an error
key will be returned in error.data.key property.
Search is not enabled for the requested user, navigate to https://bitbucket.org/search to turn it on
Too many requests, try again later
GET /users/{selected_user}/search/code
/workspaces/{workspace}/search/code
Search for code in the repositories of the specified workspace.
Note that searches can match in the file’s text (content_matches),
the path (path_matches), or both.
You can use the same syntax for the search query as in the UI.
E.g. to search for “foo” only within the repository “demo”,
use the query parameter search_query=foo+repo:demo.
Similar to other APIs, you can request more fields using a
fields query parameter. E.g. to get some more information about
the repository of matched files, use the query parameter
search_query=foo&fields=%2Bvalues.file.commit.repository
(the %2B is a URL-encoded +).
Try fields=%2Bvalues.*.*.*.* to get an idea what’s possible.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The workspace to search in; either the slug or the UUID in curly braces |
| search_query | query | required | string | The search query |
| page | query | optional | integer | Which page of the search results to retrieve |
| pagelen | query | optional | integer | How many search results to retrieve per page |
Successful search
If the search request was invalid due to one of the
following reasons:
the specified type of target account doesn’‘t match the actual
account type;
malformed pagination properties;
missing or malformed search query, in the latter case an error
key will be returned in error.data.key property.
Search is not enabled for the requested workspace, navigate to https://bitbucket.org/search to turn it on
Too many requests, try again later
GET /workspaces/{workspace}/search/code
/snippets
Returns all snippets. Like pull requests, repositories and workspaces, the
full set of snippets is defined by what the current user has access to.
This includes all snippets owned by any of the workspaces the user is a member of,
or snippets by other users that the current user is either watching or has collaborated
on (for instance by commenting on it).
To limit the set of returned snippets, apply the
?role=[owner|contributor|member] query parameter where the roles are
defined as follows:
owner: all snippets owned by the current usercontributor: all snippets owned by, or watched by the current usermember: created in a workspaces or watched by the current userWhen no role is specified, all public snippets are returned, as well as all
privately owned snippets watched or commented on.
The returned response is a normal paginated JSON list. This endpoint
only supports application/json responses and no
multipart/form-data or multipart/related. As a result, it is not
possible to include the file contents.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| role | query | optional | string | Filter down the result based on the authenticated user’s role ( |
A paginated list of snippets.
If the snippet does not exist.
GET /snippets
/snippets/{workspace}
Identical to /snippets, except that the result is further filtered
by the snippet owner and only those that are owned by {workspace} are
returned.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
| role | query | optional | string | Filter down the result based on the authenticated user’s role ( |
A paginated list of snippets.
If the user does not exist.
GET /snippets/{workspace}
/snippets/{workspace}/{encoded_id}
Retrieves a single snippet.
Snippets support multiple content types:
The default content type of the response is application/json.
Since JSON is always utf-8, it cannot reliably contain file contents
for files that are not text. Therefore, JSON snippet documents only
contain the filename and links to the file contents.
This means that in order to retrieve all parts of a snippet, N+1
requests need to be made (where N is the number of files in the
snippet).
To retrieve an entire snippet in a single response, use the
Accept: multipart/related HTTP request header.
$ curl -H "Accept: multipart/related" https://api.bitbucket.org/2.0/snippets/evzijst/1
Response:
HTTP/1.1 200 OK
Content-Length: 2214
Content-Type: multipart/related; start="snippet"; boundary="===============1438169132528273974=="
MIME-Version: 1.0
--===============1438169132528273974==
Content-Type: application/json; charset="utf-8"
MIME-Version: 1.0
Content-ID: snippet
{
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/snippets/evzijst/kypj"
},
"html": {
"href": "https://bitbucket.org/snippets/evzijst/kypj"
},
"comments": {
"href": "https://api.bitbucket.org/2.0/snippets/evzijst/kypj/comments"
},
"watchers": {
"href": "https://api.bitbucket.org/2.0/snippets/evzijst/kypj/watchers"
},
"commits": {
"href": "https://api.bitbucket.org/2.0/snippets/evzijst/kypj/commits"
}
},
"id": kypj,
"title": "My snippet",
"created_on": "2014-12-29T22:22:04.790331+00:00",
"updated_on": "2014-12-29T22:22:04.790331+00:00",
"is_private": false,
"files": {
"foo.txt": {
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/foo.txt"
},
"html": {
"href": "https://bitbucket.org/snippets/evzijst/kypj#file-foo.txt"
}
}
},
"image.png": {
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/image.png"
},
"html": {
"href": "https://bitbucket.org/snippets/evzijst/kypj#file-image.png"
}
}
}
],
"owner": {
"username": "evzijst",
"nickname": "evzijst",
"display_name": "Erik van Zijst",
"uuid": "{d301aafa-d676-4ee0-88be-962be7417567}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/evzijst"
},
"html": {
"href": "https://bitbucket.org/evzijst"
},
"avatar": {
"href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png"
}
}
},
"creator": {
"username": "evzijst",
"nickname": "evzijst",
"display_name": "Erik van Zijst",
"uuid": "{d301aafa-d676-4ee0-88be-962be7417567}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/evzijst"
},
"html": {
"href": "https://bitbucket.org/evzijst"
},
"avatar": {
"href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png"
}
}
}
}
--===============1438169132528273974==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-ID: "foo.txt"
Content-Disposition: attachment; filename="foo.txt"
foo
--===============1438169132528273974==
Content-Type: image/png
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-ID: "image.png"
Content-Disposition: attachment; filename="image.png"
iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m
TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB
cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5
EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ
73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN
AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==
--===============1438169132528273974==--
As with creating new snippets, multipart/form-data can be used as an
alternative to multipart/related. However, the inherently flat
structure of form-data means that only basic, root-level properties
can be returned, while nested elements like links are omitted:
$ curl -H "Accept: multipart/form-data" https://api.bitbucket.org/2.0/snippets/evzijst/kypj
Response:
HTTP/1.1 200 OK
Content-Length: 951
Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f
------------------------------63a4b224c59f
Content-Disposition: form-data; name="title"
Content-Type: text/plain; charset="utf-8"
My snippet
------------------------------63a4b224c59f--
Content-Disposition: attachment; name="file"; filename="foo.txt"
Content-Type: text/plain
foo
------------------------------63a4b224c59f
Content-Disposition: attachment; name="file"; filename="image.png"
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream
iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m
TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB
cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5
EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ
73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN
AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==
------------------------------5957323a6b76--
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The snippet object.
If the snippet is private and the request was not authenticated.
If authenticated user does not have access to the private snippet.
If the snippet does not exist.
If the snippet marked as spam.
GET /snippets/{workspace}/{encoded_id}
/snippets/{workspace}/{encoded_id}/comments
Used to retrieve a paginated list of all comments for a specific
snippet.
This resource works identical to commit and pull request comments.
The default sorting is oldest to newest and can be overridden with
the sort query parameter.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
A paginated list of snippet comments, ordered by creation date.
If the authenticated user does not have access to the snippet.
If the snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/comments
/snippets/{workspace}/{encoded_id}/comments/{comment_id}
Returns the specific snippet comment.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| comment_id | path | required | integer | The id of the comment. |
| encoded_id | path | required | string | The snippet id. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified comment.
If the authenticated user does not have access to the snippet.
If the comment or snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/comments/{comment_id}
/snippets/{workspace}/{encoded_id}/commits
Returns the changes (commits) made on this snippet.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The paginated list of snippet commits.
If the authenticated user does not have access to the snippet.
If the snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/commits
/snippets/{workspace}/{encoded_id}/commits/{revision}
Returns the changes made on this snippet in this commit.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| revision | path | required | string | The commit’s SHA1. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified snippet commit.
If the authenticated user does not have access to the snippet.
If the commit or the snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/commits/{revision}
/snippets/{workspace}/{encoded_id}/files/{path}
Convenience resource for getting to a snippet’s raw files without the
need for first having to retrieve the snippet itself and having to pull
out the versioned file links.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| path | path | required | string | Path to the file. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
OK
A redirect to the most recent revision of the specified file.
If the authenticated user does not have access to the snippet.
If the snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/files/{path}
/snippets/{workspace}/{encoded_id}/watch
Used to check if the current user is watching a specific snippet.
Returns 204 (No Content) if the user is watching the snippet and 404 if
not.
Hitting this endpoint anonymously always returns a 404.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
If the authenticated user is watching the snippet.
If the snippet does not exist, or if the authenticated user is not watching the snippet.
GET /snippets/{workspace}/{encoded_id}/watch
/snippets/{workspace}/{encoded_id}/{node_id}
Identical to GET /snippets/encoded_id, except that this endpoint
can be used to retrieve the contents of the snippet as it was at an
older revision, while /snippets/encoded_id always returns the
snippet’s current revision.
Note that only the snippet’s file contents are versioned, not its
meta data properties like the title.
Other than that, the two endpoints are identical in behavior.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| node_id | path | required | string | A commit revision (SHA1). |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The snippet object.
If the snippet is private and the request was not authenticated.
If authenticated user does not have access to the private snippet.
If the snippet, or the revision does not exist.
GET /snippets/{workspace}/{encoded_id}/{node_id}
/snippets/{workspace}/{encoded_id}/{node_id}/files/{path}
Retrieves the raw contents of a specific file in the snippet. The
Content-Disposition header will be “attachment” to avoid issues with
malevolent executable files.
The file’s mime type is derived from its filename and returned in the
Content-Type header.
Note that for text files, no character encoding is included as part of
the content type.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| node_id | path | required | string | A commit revision (SHA1). |
| path | path | required | string | Path to the file. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Returns the contents of the specified file.
If the authenticated user does not have access to the snippet.
If the file or snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/{node_id}/files/{path}
/snippets/{workspace}/{encoded_id}/{revision}/diff
Returns the diff of the specified commit against its first parent.
Note that this resource is different in functionality from the patch
resource.
The differences between a diff and a patch are:
path=foo/bar.py query param to filter theNote that the character encoding of the contents of the diff is
unspecified as Git does not track this, making it hard for
Bitbucket to reliably determine this.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| revision | path | required | string | A revspec expression. This can simply be a commit SHA1, a ref name, or a compare expression like |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
| path | query | optional | string | When used, only one the diff of the specified file will be returned. |
The raw diff contents.
If the authenticated user does not have access to the snippet.
If the snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/{revision}/diff
/snippets/{workspace}/{encoded_id}/{revision}/patch
Returns the patch of the specified commit against its first
parent.
Note that this resource is different in functionality from the diff
resource.
The differences between a diff and a patch are:
path=foo/bar.py query param to filter theNote that the character encoding of the contents of the patch is
unspecified as Git does not track this, making it hard for
Bitbucket to reliably determine this.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| encoded_id | path | required | string | The snippet id. |
| revision | path | required | string | A revspec expression. This can simply be a commit SHA1, a ref name, or a compare expression like |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The raw patch contents.
If the authenticated user does not have access to the snippet.
If the snippet does not exist.
GET /snippets/{workspace}/{encoded_id}/{revision}/patch
/repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path}
Returns a paginated list of commits that modified the specified file.
Commits are returned in reverse chronological order. This is roughly
equivalent to the following commands:
$ git log --follow --date-order <sha> <path>
By default, Bitbucket will follow renames and the path name in the
returned entries reflects that. This can be turned off using the
?renames=false query parameter.
Results are returned in descending chronological order by default, and
like most endpoints you can
filter and sort the response to
only provide exactly the data you want.
The example response returns commits made before 2011-05-18 against a file
named README.rst. The results are filtered to only return the path and
date. This request can be made using:
$ curl 'https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/filehistory/master/README.rst'\
'?fields=values.next,values.path,values.commit.date&q=commit.date<=2011-05-18'
In the response you can see that the file was renamed to README.rst
by the commit made on 2011-05-16, and was previously named README.txt.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| commit | path | required | string | The commit’s SHA1. |
| path | path | required | string | Path to the file. |
| 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 |
| renames | query | optional | string |
When |
| q | query | optional | string |
Query string to narrow down the response as per |
| sort | query | optional | string |
Name of a response property sort the result by as per |
A paginated list of commits that modified the specified file
If the repository does not exist.
GET /repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path}
/repositories/{workspace}/{repo_slug}/src
This endpoint redirects the client to the directory listing of the
root directory on the main branch.
This is equivalent to directly hitting
/2.0/repositories/{username}/{repo_slug}/src/{commit}/{path}
without having to know the name or SHA1 of the repo’s main branch.
To create new commits, POST to this endpoint
| 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 |
| format | query | optional | string | Instead of returning the file’s contents, return the (json) meta data for it. |
If the path matches a file, then the raw contents of the file are
returned (unless the format=meta query parameter was provided,
in which case a json document containing the file’s meta data is
returned). If the path matches a directory, then a paginated
list of file and directory entries is returned (if the
format=meta query parameter was provided, then the json document
containing the directory’s meta data is returned).
If the path or commit in the URL does not exist.
GET /repositories/{workspace}/{repo_slug}/src
/repositories/{workspace}/{repo_slug}/src/{commit}/{path}
This endpoints is used to retrieve the contents of a single file,
or the contents of a directory at a specified revision.
When path points to a file, this endpoint returns the raw contents.
The response’s Content-Type is derived from the filename
extension (not from the contents). The file contents are not processed
and no character encoding/recoding is performed and as a result no
character encoding is included as part of the Content-Type.
The Content-Disposition header will be “attachment” to prevent
browsers from running executable files.
If the file is managed by LFS, then a 301 redirect pointing to
Atlassian’s media services platform is returned.
The response includes an ETag that is based on the contents of the file
and its attributes. This means that an empty __init__.py always
returns the same ETag, regardless on the directory it lives in, or the
commit it is on.
When the request for a file path includes the query parameter
?format=meta, instead of returning the file’s raw contents, Bitbucket
instead returns the JSON object describing the file’s properties:
$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests/__init__.py?format=meta
{
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py"
},
"meta": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta"
}
},
"path": "tests/__init__.py",
"commit": {
"type": "commit",
"hash": "eefd5ef5d3df01aed629f650959d6706d54cd335",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335"
},
"html": {
"href": "https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335"
}
}
},
"attributes": [],
"type": "commit_file",
"size": 0
}
File objects contain an attributes element that contains a list of
possible modifiers. Currently defined values are:
link – indicates that the entry is a symbolic link. The contentsexecutable – indicates that the file has the executable bit set.subrepository – indicates that the entry points to a submodule orbinary – indicates whether Bitbucket thinks the file is binary.This endpoint can provide an alternative to how a HEAD request can be
used to check for the existence of a file, or a file’s size without
incurring the overhead of receiving its full contents.
When path points to a directory instead of a file, the response is a
paginated list of directory and file objects in the same order as the
underlying SCM system would return them.
For example:
$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests
{
"pagelen": 10,
"values": [
{
"path": "tests/test_project",
"type": "commit_directory",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/"
},
"meta": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta"
}
},
"commit": {
"type": "commit",
"hash": "eefd5ef5d3df01aed629f650959d6706d54cd335",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335"
},
"html": {
"href": "https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335"
}
}
}
},
{
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py"
},
"meta": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta"
}
},
"path": "tests/__init__.py",
"commit": {
"type": "commit",
"hash": "eefd5ef5d3df01aed629f650959d6706d54cd335",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335"
},
"html": {
"href": "https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335"
}
}
},
"attributes": [],
"type": "commit_file",
"size": 0
}
],
"page": 1,
"size": 2
}
When listing the contents of the repo’s root directory, the use of a
trailing slash at the end of the URL is required.
The response by default is not recursive, meaning that only the direct contents of
a path are returned. The response does not recurse down into
subdirectories. In order to “walk” the entire directory tree, the
client can either parse each response and follow the self links of each
commit_directory object, or can specify a max_depth to recurse to.
The max_depth parameter will do a breadth-first search to return the contents of the subdirectories
up to the depth specified. Breadth-first search was chosen as it leads to the least amount of
file system operations for git. If the max_depth parameter is specified to be too
large, the call will time out and return a 555.
Each returned object is either a commit_file, or a commit_directory,
both of which contain a path element. This path is the absolute path
from the root of the repository. Each object also contains a commit
object which embeds the commit the file is on. Note that this is merely
the commit that was used in the URL. It is not the commit that last
modified the file.
Directory objects have 2 representations. Their self link returns the
paginated contents of the directory. The meta link on the other hand
returns the actual directory object itself, e.g.:
{
"path": "tests/test_project",
"type": "commit_directory",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/"
},
"meta": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta"
}
},
"commit": { ... }
}
Like most API endpoints, this API supports the Bitbucket
querying/filtering syntax and so you could filter a directory listing
to only include entries that match certain criteria. For instance, to
list all binary files over 1kb use the expression:
size > 1024 and attributes = "binary"
which after urlencoding yields the query string:
?q=size%3E1024+and+attributes%3D%22binary%22
To change the ordering of the response, use the ?sort parameter:
.../src/eefd5ef/?sort=-size
See filtering and sorting for more
details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| commit | path | required | string | The commit’s SHA1. |
| path | path | required | string | Path to the file. |
| 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 |
| format | query | optional | string | If ‘meta’ is provided, returns the (json) meta data for the contents of the file. If ‘rendered’ is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. The ‘rendered’ option only supports these filetypes: |
| q | query | optional | string | Optional filter expression as per filtering and sorting. |
| sort | query | optional | string | Optional sorting parameter as per filtering and sorting. |
| max_depth | query | optional | integer | If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1. |
If the path matches a file, then the raw contents of the file are
returned. If the format=meta query parameter is provided,
a json document containing the file’s meta data is
returned. If the format=rendered query parameter is provided,
the contents of the file in HTML-formated rendered markup is returned.
If the path matches a directory, then a paginated
list of file and directory entries is returned (if the
format=meta query parameter was provided, then the json document
containing the directory’s meta data is returned.)
If the path or commit in the URL does not exist.
If the call times out, possibly because the specified recursion depth is too large.
GET /repositories/{workspace}/{repo_slug}/src/{commit}/{path}
/users/{selected_user}/ssh-keys
Returns a paginated list of the user’s SSH public keys.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| selected_user | path | required | string | This can either be an Atlassian Account ID OR the UUID of the account, |
A list of the SSH keys associated with the account.
If the specified user’s keys are not accessible to the current user
If the specified user does not exist
GET /users/{selected_user}/ssh-keys
/users/{selected_user}/ssh-keys/{key_id}
Returns a specific SSH public key belonging to a user.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| key_id | path | required | string | The SSH key’s UUID value. |
| selected_user | path | required | string | This can either be an Atlassian Account ID OR the UUID of the account, |
The specific SSH key matching the user and UUID
If the specified user or key is not accessible to the current user
If the specified user or key does not exist
GET /users/{selected_user}/ssh-keys/{key_id}
/users/{selected_user}
Gets the public information associated with a user account.
If the user’s profile is private, location, website and
created_on elements are omitted.
Note that the user object returned by this operation is changing significantly, due to privacy changes.
See the announcement for details.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| selected_user | path | required | string | This can either be an Atlassian Account ID OR the UUID of the account, |
The user object
If no user exists for the specified UUID, or if the specified account is a team account, not a personal account.
GET /users/{selected_user}
/user
Returns the currently logged in user.
The current user.
When the request wasn’t authenticated.
GET /user
/user/emails
Returns all the authenticated user’s email addresses. Both
confirmed and unconfirmed.
Unexpected error.
GET /user/emails
/user/emails/{email}
Returns details about a specific one of the authenticated user’s
email addresses.
Details describe whether the address has been confirmed by the user and
whether it is the user’s primary address or not.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| path | required | string | Email address of the user. |
Unexpected error.
GET /user/emails/{email}
/hook_events
Returns the webhook resource or subject types on which webhooks can
be registered.
Each resource/subject type contains an events link that returns the
paginated list of specific events each individual subject type can
emit.
This endpoint is publicly accessible and does not require
authentication or scopes.
A mapping of resource/subject types pointing to their individual event types.
GET /hook_events
/hook_events/{subject_type}
Returns a paginated list of all valid webhook events for the
specified entity.
The team and user webhooks are deprecated, and you should use workspace instead.
For more information, see the announcement.
This is public data that does not require any scopes or authentication.
NOTE: The example response is a truncated response object for the workspace subject_type.
We return the same structure for the other subject_type objects.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| subject_type | path | required | string | A resource or subject type. |
A paginated list of webhook types available to subscribe on.
If an invalid {subject_type} value was specified.
GET /hook_events/{subject_type}
/workspaces
Returns a list of workspaces accessible by the authenticated user.
Results may be further filtered or sorted by
workspace or permission by adding the following query string parameters:
q=slug="bbworkspace1" or q=is_private=truesort=created_onNote that the query parameter values need to be URL escaped so that =
would become %3D.
The collaborator role is being removed from the Bitbucket Cloud API. For more information,
see the deprecation announcement.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| role | query | optional | string |
|
| q | query | optional | string |
Query string to narrow down the response. See |
| sort | query | optional | string |
Name of a response property to sort results. See |
The list of workspaces accessible by the authenticated user.
The request wasn’t authenticated.
GET /workspaces
/workspaces/{workspace}
Returns the requested workspace.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The workspace.
If no workspace exists for the specified name or UUID.
GET /workspaces/{workspace}
/workspaces/{workspace}/members
Returns all members of the requested workspace.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The list of users that are part of a workspace.
The request wasn’t authenticated.
GET /workspaces/{workspace}/members
/workspaces/{workspace}/members/{member}
Returns the workspace membership, which includes
a User object for the member and a Workspace object
for the requested workspace.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| member | path | required | string | Member’s UUID or Atlassian ID. |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The user that is part of a workspace.
The request wasn’t authenticated.
A workspace cannot be found, or a user cannot be found, or the user is not a a member of the workspace.
GET /workspaces/{workspace}/members/{member}
/workspaces/{workspace}/permissions
Returns the list of members in a workspace
and their permission levels.
Permission can be:
ownercollaboratormemberThe collaborator role is being removed from the Bitbucket Cloud API. For more information,
see the deprecation announcement.
When you move your administration from Bitbucket Cloud to admin.atlassian.com, the following fields on
workspace_membership will no longer be present: last_accessed and added_on. See the
deprecation announcement.
Results may be further filtered by
permission by adding the following query string parameters:
q=permission="owner"| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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 |
The list of users that are part of a workspace, along with their permission.
The request wasn’t authenticated.
GET /workspaces/{workspace}/permissions
/workspaces/{workspace}/permissions/repositories
Returns an object for each repository permission for all of a
workspace’s repositories.
Permissions returned are effective permissions: the highest level of
permission the user has. This does not distinguish between direct and
indirect (group) privileges.
Only users with admin permission for the team may access this resource.
Permissions can be:
adminwritereadResults may be further filtered or sorted
by repository, user, or permission by adding the following query string
parameters:
q=repository.name="geordi" or q=permission>"read"sort=user.display_nameNote that the query parameter values need to be URL escaped so that =
would become %3D.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| 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 |
Name of a response property sort the result by as per |
List of workspace’s repository permissions.
The requesting user isn’t an admin of the workspace.
GET /workspaces/{workspace}/permissions/repositories
/workspaces/{workspace}/permissions/repositories/{repo_slug}
Returns an object for the repository permission of each user in the
requested repository.
Permissions returned are effective permissions: the highest level of
permission the user has. This does not distinguish between direct and
indirect (group) privileges.
Only users with admin permission for the repository may access this resource.
Permissions can be:
adminwritereadResults may be further filtered or sorted
by user, or permission by adding the following query string parameters:
q=permission>"read"sort=user.display_nameNote that the query parameter values need to be URL escaped so that =
would become %3D.
| 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 |
| q | query | optional | string |
Query string to narrow down the response as per |
| sort | query | optional | string |
Name of a response property sort the result by as per |
The repository permission for all users in this repository.
The requesting user isn’t an admin of the repository.
GET /workspaces/{workspace}/permissions/repositories/{repo_slug}
/workspaces/{workspace}/projects
Returns the list of projects in this workspace.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The list of projects in this workspace.
A workspace doesn’t exist at this location.
GET /workspaces/{workspace}/projects
/user/permissions/workspaces
Returns an object for each workspace the caller is a member of, and
their effective role - the highest level of privilege the caller has.
If a user is a member of multiple groups with distinct roles, only the
highest level is returned.
Permissions can be:
ownercollaboratormemberThe collaborator role is being removed from the Bitbucket Cloud API. For more information,
see the deprecation announcement.
When you move your administration from Bitbucket Cloud to admin.atlassian.com, the following fields on
workspace_membership will no longer be present: last_accessed and added_on. See the
deprecation announcement.
Results may be further filtered or sorted by
workspace or permission by adding the following query string parameters:
q=workspace.slug="bbworkspace1" or q=permission="owner"sort=workspace.slugNote that the query parameter values need to be URL escaped so that =
would become %3D.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| q | query | optional | string |
Query string to narrow down the response. See |
| sort | query | optional | string |
Name of a response property to sort results. See |
All of the workspace memberships for the authenticated user.
The request wasn’t authenticated.
GET /user/permissions/workspaces
/workspaces/{workspace}/hooks
Returns a paginated list of webhooks installed on this workspace.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The paginated list of installed webhooks.
If the authenticated user is not an owner on the specified workspace.
If the specified workspace does not exist.
GET /workspaces/{workspace}/hooks
/workspaces/{workspace}/hooks/{uid}
Returns the webhook with the specified id installed on the given
workspace.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| uid | path | required | string | Installed webhook’s ID |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The webhook subscription object.
If the webhook or workspace does not exist.
GET /workspaces/{workspace}/hooks/{uid}
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 |