/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
| 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 |
An empty response indicating the authenticated user’s request for change has been withdrawn.
Pull request requested changes cannot be removed because the pull request has already been merged.
The request wasn’t authenticated.
The specified pull request or the repository does not exist.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
| 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 participant object recording that the authenticated user requested changes on the pull request.
Pull request changes cannot be requested because the pull request has already been merged.
The request wasn’t authenticated.
The specified pull request or the repository does not exist.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
/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}/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
Creates a new pull request task.
Returns the newly created pull request task.
Tasks can optionally be created in relation to a comment specified by the comment’s ID which
will cause the task to appear below the comment on a pull request when viewed in Bitbucket.
| 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 contents of the task
application/json
A_pullrequest_task_create
| Property | Type | Required |
|---|---|---|
| comment | object | optional |
| └ type | string | required |
| └ id | integer | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ links | object | optional |
| └ code | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ inline | object | optional |
| └ to | integer | optional |
| └ from | integer | optional |
| └ path | string | required |
| └ parent | object | optional |
| └ content | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ deleted | boolean | optional |
| └ created_on | string | optional |
| └ updated_on | string | optional |
| content | object | required |
| └ raw | string | required |
| pending | boolean | optional |
The newly created task.
There is a missing required field in the request or the task content is blank.
If the authenticated user does not have access to the pull request.
If the pull request does not exist.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
Deletes 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 |
Successful deletion.
If the authenticated user does not have access to delete the task.
If the task does not exist.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
/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}/pullrequests/{pull_request_id}/tasks/{task_id}
Updates 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 updated state and content of the task.
application/json
A_pullrequest_task_update
| Property | Type | Required |
|---|---|---|
| state | string | optional |
| content | object | optional |
| └ raw | string | required |
The updated task.
There is a missing required field in the request or the task content is blank.
If the authenticated user does not have access to the pull request.
If the task does not exist.
PUT /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
Creates a new branch in the specified repository.
The payload of the POST should consist of a JSON document that
contains the name of the tag and the target hash.
curl https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/branches \
-s -u seanfarley -X POST -H "Content-Type: application/json" \
-d '{
"name" : "smf/create-feature",
"target" : {
"hash" : "default",
}
}'
This call requires authentication. Private repositories require the
caller to authenticate with an account that has appropriate
authorization.
The branch name should not include any prefixes (e.g.
refs/heads). This endpoint does support using short hash prefixes for
the commit hash, but it may return a 400 response if the provided
prefix is ambiguous. Using a full commit hash is the preferred
approach.
| 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 newly created 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.
POST /repositories/{workspace}/{repo_slug}/refs/branches
/repositories/{workspace}/{repo_slug}/refs/branches/{name}
Delete a branch in the specified repository.
The main branch is not allowed to be deleted and will return a 400
response.
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 |
Indicates that the specified branch was successfully deleted.
If the repository is private and the authenticated user does not have
access to it.
The specified repository or branch does not exist.
DELETE /repositories/{workspace}/{repo_slug}/refs/branches/{name}
/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
Creates a new tag in the specified repository.
The payload of the POST should consist of a JSON document that
contains the name of the tag and the target hash.
curl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \
-s -u jdoe -X POST -H "Content-Type: application/json" \
-d '{
"name" : "new-tag-name",
"target" : {
"hash" : "a1b2c3d4e5f6",
}
}'
This endpoint does support using short hash prefixes for the commit
hash, but it may return a 400 response if the provided prefix is
ambiguous. Using a full commit hash is the preferred approach.
| 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 |
application/json
tag
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| type | string | required |
| links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| target | object | optional |
| └ type | string | required |
| └ date | string | optional |
| └ hash | string | optional |
| └ author | object | optional |
| └ type | string | required |
| └ raw | string | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ message | string | optional |
| └ parents | array | optional |
| └ summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ clone | array | optional |
| └ forks | object | optional |
| └ hooks | object | optional |
| └ avatar | object | optional |
| └ commits | object | optional |
| └ watchers | object | optional |
| └ downloads | object | optional |
| └ pullrequests | object | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| └ participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| date | string | optional |
| tagger | object | optional |
| └ type | string | required |
| └ raw | string | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| message | string | optional |
The newly created tag.
If the target hash is missing, ambiguous, or invalid, or if the name is not provided.
POST /repositories/{workspace}/{repo_slug}/refs/tags
/repositories/{workspace}/{repo_slug}/refs/tags/{name}
Delete a tag in the specified repository.
The tag name should not include any prefixes (e.g. refs/tags).
| 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 |
Indicates the specified tag was successfully deleted.
If the repository is private and the authenticated user does not have
access to it.
The specified repository or tag does not exist.
DELETE /repositories/{workspace}/{repo_slug}/refs/tags/{name}
/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}
Deletes 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. |
No content
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
/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}
Creates or updates a report for the specified commit.
To upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system’s name to avoid collisions, for example, mySystem-001.
curl --request PUT 'https://api.bitbucket.org/2.0/repositories/<username>/<reposity-name>/commit/<commit-hash>/reports/mysystem-001' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Security scan report",
"details": "This pull request introduces 10 new dependency vulnerabilities.",
"report_type": "SECURITY",
"reporter": "mySystem",
"link": "http://www.mysystem.com/reports/001",
"result": "FAILED",
"data": [
{
"title": "Duration (seconds)",
"type": "DURATION",
"value": 14
},
{
"title": "Safe to merge?",
"type": "BOOLEAN",
"value": false
}
]
}'
report_type: SECURITY, COVERAGE, TEST, BUG
result: PASSED, FAILED, PENDING
data.type: BOOLEAN, DATE, DURATION, LINK, NUMBER, PERCENTAGE, TEXT
| Type Field | Value Field Type | Value Field Display |
|:————–|:——————|:——————–|
| None/ Omitted | Number, String or Boolean (not an array or object) | Plain text |
| BOOLEAN | Boolean | The value will be read as a JSON boolean and displayed as ‘Yes’ or ‘No’. |
| DATE | Number | The value will be read as a JSON number in the form of a Unix timestamp (milliseconds) and will be displayed as a relative date if the date is less than one week ago, otherwise it will be displayed as an absolute date. |
| DURATION | Number | The value will be read as a JSON number in milliseconds and will be displayed in a human readable duration format. |
| LINK | Object: {"text": "Link text here", "href": "https://link.to.annotation/in/external/tool"} | The value will be read as a JSON object containing the fields “text” and “href” and will be displayed as a clickable link on the report. |
| NUMBER | Number | The value will be read as a JSON number and large numbers will be displayed in a human readable format (e.g. 14.3k). |
| PERCENTAGE | Number (between 0 and 100) | The value will be read as a JSON number between 0 and 100 and will be displayed with a percentage sign. |
| TEXT | String | The value will be read as a JSON string and will be displayed as-is |
Please refer to the Code Insights documentation for more information.
| 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. |
The report to create or update
application/json
report
| Property | Type | Required |
|---|---|---|
| type | string | required |
| data | array | optional |
| └ type | string | optional |
| └ title | string | optional |
| └ value | object | optional |
| link | string | optional |
| uuid | string | optional |
| title | string | optional |
| result | string | optional |
| details | string | optional |
| logo_url | string | optional |
| reporter | string | optional |
| created_on | string | optional |
| updated_on | string | optional |
| external_id | string | optional |
| report_type | string | optional |
| remote_link_enabled | boolean | optional |
OK
The provided Report object is malformed or incomplete.
PUT /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
Bulk upload of annotations.
Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.
Add the annotations you want to upload as objects in a JSON array and make sure each annotation has the external_id field set to a unique value. If you want to use an existing id from your own system, we recommend prefixing it with your system’s name to avoid collisions, for example, mySystem-annotation001. The external id can later be used to identify the report as an alternative to the generated UUID. You can upload up to 100 annotations per POST request.
curl --location 'https://api.bitbucket.org/2.0/repositories/<username>/<reposity-name>/commit/<commit-hash>/reports/mysystem-001/annotations' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"external_id": "mysystem-annotation001",
"title": "Security scan report",
"annotation_type": "VULNERABILITY",
"summary": "This line represents a security threat.",
"severity": "HIGH",
"path": "my-service/src/main/java/com/myCompany/mysystem/logic/Main.java",
"line": 42
},
{
"external_id": "mySystem-annotation002",
"title": "Bug report",
"annotation_type": "BUG",
"result": "FAILED",
"summary": "This line might introduce a bug.",
"severity": "MEDIUM",
"path": "my-service/src/main/java/com/myCompany/mysystem/logic/Helper.java",
"line": 13
}
]'
annotation_type: VULNERABILITY, CODE_SMELL, BUG
result: PASSED, FAILED, IGNORED, SKIPPED
severity: HIGH, MEDIUM, LOW, CRITICAL
Please refer to the Code Insights documentation for more information.
| 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. |
The annotations to create or update
application/json
ReportsBulkCreateOrUpdateAnnotationsRequest
of object
| Property | Type | Required |
|---|---|---|
| type | string | required |
| line | integer | optional |
| link | string | optional |
| path | string | optional |
| uuid | string | optional |
| result | string | optional |
| details | string | optional |
| summary | string | optional |
| severity | string | optional |
| created_on | string | optional |
| updated_on | string | optional |
| external_id | string | optional |
| annotation_type | string | optional |
OK
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
Deletes 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 annotation belongs to. |
| reportId | path | required | string | Either the uuid or external-id of the annotation. |
| annotationId | path | required | string | Either the uuid or external-id of the annotation. |
No content
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
/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/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
Creates or updates an individual annotation for the specified report.
Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.
Just as reports, annotation needs to be uploaded with a unique ID that can later be used to identify the report as an alternative to the generated UUID. If you want to use an existing id from your own system, we recommend prefixing it with your system’s name to avoid collisions, for example, mySystem-annotation001.
curl --request PUT 'https://api.bitbucket.org/2.0/repositories/<username>/<reposity-name>/commit/<commit-hash>/reports/mySystem-001/annotations/mysystem-annotation001' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Security scan report",
"annotation_type": "VULNERABILITY",
"summary": "This line represents a security thread.",
"severity": "HIGH",
"path": "my-service/src/main/java/com/myCompany/mysystem/logic/Main.java",
"line": 42
}'
annotation_type: VULNERABILITY, CODE_SMELL, BUG
result: PASSED, FAILED, IGNORED, SKIPPED
severity: HIGH, MEDIUM, LOW, CRITICAL
Please refer to the Code Insights documentation for more information.
| 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. |
The annotation to create or update
application/json
report_annotation
| Property | Type | Required |
|---|---|---|
| type | string | required |
| line | integer | optional |
| link | string | optional |
| path | string | optional |
| uuid | string | optional |
| result | string | optional |
| details | string | optional |
| summary | string | optional |
| severity | string | optional |
| created_on | string | optional |
| updated_on | string | optional |
| external_id | string | optional |
| annotation_type | string | optional |
OK
The provided Annotation object is malformed or incomplete.
PUT /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}
Deletes the repository. This is an irreversible operation.
This does not affect its forks.
| 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 |
| redirect_to | query | optional | string | If a repository has been moved to a new location, use this parameter to |
Indicates successful deletion.
If the caller either does not have admin access to the repository, or the repository is set to read-only.
If the repository does not exist.
DELETE /repositories/{workspace}/{repo_slug}
/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}
Creates a new repository.
Note: In order to set the project for the newly created repository,
pass in either the project key or the project UUID as part of the
request body as shown in the examples below:
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "MARS"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
or
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "{ba516952-992a-4c2d-acbd-17d502922f96}"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
The project must be assigned for all repositories. If the project is not provided,
the repository is automatically assigned to the oldest project in the workspace.
Note: In the examples above, the workspace ID teamsinspace,
and/or the repository name hablanding can be replaced by UUIDs.
| 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 that is to be created. Note that most object elements are optional. Elements “owner” and “full_name” are ignored as the URL implies them.
application/json
repository
| Property | Type | Required |
|---|---|---|
| type | string | required |
| scm | string | optional |
| name | string | optional |
| size | integer | optional |
| uuid | string | optional |
| links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ clone | array | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ forks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ hooks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ watchers | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ downloads | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ pullrequests | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| parent | object | optional |
| project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ members | object | optional |
| └ projects | object | optional |
| └ repositories | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| has_wiki | boolean | optional |
| language | string | optional |
| full_name | string | optional |
| created_on | string | optional |
| has_issues | boolean | optional |
| is_private | boolean | optional |
| mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ target | object | optional |
| └ type | string | required |
| └ date | string | optional |
| └ hash | string | optional |
| └ author | object | optional |
| └ type | string | required |
| └ raw | string | optional |
| └ user | object | optional |
| └ message | string | optional |
| └ parents | array | optional |
| └ summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ repository | object | optional |
| └ participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| updated_on | string | optional |
| description | string | optional |
| fork_policy | string | optional |
The newly created repository.
If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.
If the request was not authenticated.
POST /repositories/{workspace}/{repo_slug}
/repositories/{workspace}/{repo_slug}
Since this endpoint can be used to both update and to create a
repository, the request body depends on the intent.
See the POST documentation for the repository endpoint for an example
of the request body.
Note: Changing the name of the repository will cause the location to
be changed. This is because the URL of the repo is derived from the
name (a process called slugification). In such a scenario, it is
possible for the request to fail if the newly created slug conflicts
with an existing repository’s slug. But if there is no conflict,
the new location will be returned in the Location header of the
response.
| 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 that is to be updated.
Note that the elements “owner” and “full_name” are ignored since the
URL implies them.
application/json
repository
| Property | Type | Required |
|---|---|---|
| type | string | required |
| scm | string | optional |
| name | string | optional |
| size | integer | optional |
| uuid | string | optional |
| links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ clone | array | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ forks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ hooks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ watchers | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ downloads | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ pullrequests | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| parent | object | optional |
| project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ members | object | optional |
| └ projects | object | optional |
| └ repositories | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| has_wiki | boolean | optional |
| language | string | optional |
| full_name | string | optional |
| created_on | string | optional |
| has_issues | boolean | optional |
| is_private | boolean | optional |
| mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ target | object | optional |
| └ type | string | required |
| └ date | string | optional |
| └ hash | string | optional |
| └ author | object | optional |
| └ type | string | required |
| └ raw | string | optional |
| └ user | object | optional |
| └ message | string | optional |
| └ parents | array | optional |
| └ summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ repository | object | optional |
| └ participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| updated_on | string | optional |
| description | string | optional |
| fork_policy | string | optional |
The existing repository has been updated
A new repository has been created
If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.
If the request was not authenticated.
PUT /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}/forks
Creates a new fork of the specified repository.
To create a fork, specify the workspace explicitly as part of the
request body:
$ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \
-H 'Content-Type: application/json' -d '{
"name": "bbql_fork",
"workspace": {
"slug": "atlassian"
}
}'
To fork a repository into the same workspace, also specify a new name.
When you specify a value for name, it will also affect the slug.
The slug is reflected in the repository URL of the new fork. It is
derived from name by substituting non-ASCII characters, removes
whitespace, and changes characters to lower case. For example,
My repo would turn into my_repo.
You need contributor access to create new forks within a workspace.
By default the fork inherits most of its properties from the parent.
However, since the optional POST body document follows the normal
repository JSON schema and you can override the new fork’s
properties.
Properties that can be overridden include:
is_private=False would fail)is_privatetrue)Properties that cannot be modified include:
| 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 repository object. This can be left blank.
application/json
repository
| Property | Type | Required |
|---|---|---|
| type | string | required |
| scm | string | optional |
| name | string | optional |
| size | integer | optional |
| uuid | string | optional |
| links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ clone | array | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ forks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ hooks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ watchers | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ downloads | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ pullrequests | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| parent | object | optional |
| project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ members | object | optional |
| └ projects | object | optional |
| └ repositories | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| has_wiki | boolean | optional |
| language | string | optional |
| full_name | string | optional |
| created_on | string | optional |
| has_issues | boolean | optional |
| is_private | boolean | optional |
| mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ target | object | optional |
| └ type | string | required |
| └ date | string | optional |
| └ hash | string | optional |
| └ author | object | optional |
| └ type | string | required |
| └ raw | string | optional |
| └ user | object | optional |
| └ message | string | optional |
| └ parents | array | optional |
| └ summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ repository | object | optional |
| └ participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| updated_on | string | optional |
| description | string | optional |
| fork_policy | string | optional |
The newly created fork.
POST /repositories/{workspace}/{repo_slug}/forks
/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
Creates a new webhook on the specified repository.
Example:
$ curl -X POST -u credentials -H 'Content-Type: application/json'
https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo-slug/hooks
-d '
{
"description": "Webhook Description",
"url": "https://example.com/",
"active": true,
"secret": "this is a really bad secret",
"events": [
"repo:push",
"issue:created",
"issue:updated"
]
}'
When the secret is provided it will be used as the key to generate a HMAC
digest value sent in the X-Hub-Signature header at delivery time. Passing
a null or empty secret or not passing a secret will leave the webhook’s
secret unset. Bitbucket only generates the X-Hub-Signature when the webhook’s
secret is set.
Note that this call requires the webhook scope, as well as any scope
that applies to the events that the webhook subscribes to. In the
example above that means: webhook, repository and issue.
Also note that the url must properly resolve and cannot be an
internal, non-routed address.
| 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 |
If the webhook was registered successfully.
If the authenticated user does not have permission to install webhooks on the specified repository.
If the repository does not exist.
POST /repositories/{workspace}/{repo_slug}/hooks
/repositories/{workspace}/{repo_slug}/hooks/{uid}
Deletes the specified webhook subscription from the given
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 |
When the webhook was deleted successfully
If the authenticated user does not have permission to delete the webhook.
If the webhook or repository does not exist.
DELETE /repositories/{workspace}/{repo_slug}/hooks/{uid}
/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}
/repositories/{workspace}/{repo_slug}/hooks/{uid}
Updates the specified webhook subscription.
The following properties can be mutated:
descriptionurlsecretactiveeventsThe hook’s secret is used as a key to generate the HMAC hex digest sent in the
X-Hub-Signature header at delivery time. This signature is only generated
when the hook has a secret.
Set the hook’s secret by passing the new value in the secret field. Passing a
null value in the secret field will remove the secret from the hook. The
hook’s secret can be left unchanged by not passing the secret field in the
request.
| 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 authenticated user does not have permission to update the webhook.
If the webhook or repository does not exist.
PUT /repositories/{workspace}/{repo_slug}/hooks/{uid}
/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}/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 was set and no content returned
If no repository exists at this location
PUT /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}
Deletes the repository group permission between the requested repository and group, if one exists.
Only users with admin permission for the repository may access this resource.
| 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 deleted
The user couldn’t be authenticated.
The requesting user isn’t an admin of the repository, or the authentication method was not via app password.
The workspace does not exist, the repository does not exist, or the group does not exist.
DELETE /repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
/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/groups/{group_slug}
Updates the group permission, or grants a new permission if one does not already exist.
Only users with admin permission for the repository may access this resource.
The only authentication method supported for this endpoint is via app passwords.
Permissions can be:
adminwriteread| 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 |
The permission to grant
application/json
bitbucket.apps.permissions.serializers.RepoPermissionUpdateSchema
| Property | Type | Required |
|---|---|---|
| permission | string | required |
Group permission updated
No permission value was provided or the value is invalid(not one of read, write, or admin)
The user couldn’t be authenticated.
You have reached your plan’s user limit and must upgrade before giving access to additional users.
The requesting user isn’t an admin of the repository, or the authentication method was not via app password.
The workspace does not exist, the repository does not exist, or the group does not exist.
PUT /repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
/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}
Deletes the repository user permission between the requested repository and user, if one exists.
Only users with admin permission for the repository may access this resource.
The only authentication method for this endpoint is via app passwords.
| 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 |
The repository user permission was deleted and no content returned.
The user couldn’t be authenticated.
The requesting user isn’t an admin of the repository, or the authentication method was not via app password.
One or more of the workspace, repository, and user doesn’t exist for the given identifiers.
DELETE /repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
/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}/permissions-config/users/{selected_user_id}
Updates the explicit user permission for a given user and repository. The selected user must be a member of
the workspace, and cannot be the workspace owner.
Only users with admin permission for the repository may access this resource.
The only authentication method for this endpoint is via app passwords.
Permissions can be:
adminwriteread| 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 |
The permission to grant
application/json
bitbucket.apps.permissions.serializers.RepoPermissionUpdateSchema
| Property | Type | Required |
|---|---|---|
| permission | string | required |
Explicit user permission updated
No permission value was provided or the value is invalid (not one of read, write, or admin), or the selected user is not a valid user to update.
The user couldn’t be authenticated.
You have reached your plan’s user limit and must upgrade before giving access to additional users.
The requesting user isn’t an admin of the repository, or the authentication method was not via app password.
One or more of the workspace, repository, and selected user doesn’t exist for the given identifiers.
PUT /repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
/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