Rate this page:
Pull requests are a feature that makes it easier for developers to collaborate using Bitbucket. They provide a user-friendly web interface for discussing proposed changes before integrating them into the official project.
GET /2.0/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.
pullrequest
string
This can either be the username of the pull request author, the author's UUID
surrounded by curly-braces, for example: {account UUID}
, or the author's Atlassian ID.
string
Only return pull requests that are in this state. This parameter can be repeated.
Valid values: MERGED
, SUPERSEDED
, OPEN
, DECLINED
1 2 3 4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/pullrequests/{selected_user}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
All pull requests authored by the specified user.
Content type | Value |
---|---|
application/json |
GET /2.0/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.
NONE
string
This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces
string
The repository; either the UUID in curly braces, or the slug
string
The SHA1 of the commit
integer
Which page to retrieve
1
, Format: int32
integer
How many pull requests to retrieve per page
30
, Format: int32
1 2 3
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests' \
--header 'Accept: application/json'
The paginated list of pull requests.
Content type | Value |
---|---|
application/json |
GET /2.0/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.
pullrequest
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
1 2 3
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/default-reviewers' \
--header 'Authorization: Bearer <access_token>'
The paginated list of default reviewers
A schema has not been defined for this response code.
GET /2.0/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.
pullrequest
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the username or the UUID of the default reviewer,
surrounded by curly-braces, for example: {account UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
1 2 3
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}' \
--header 'Authorization: Bearer <access_token>'
The specified user is a default reviewer
A schema has not been defined for this response code.
PUT /2.0/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
Adds the specified user to the repository's list of default reviewers. This method is idempotent. Adding a user a second time has no effect.
repository:admin
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the username or the UUID of the default reviewer,
surrounded by curly-braces, for example: {account UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
1 2 3
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}' \
--header 'Authorization: Bearer <access_token>'
The specified user was successfully added to the default reviewers
A schema has not been defined for this response code.
DELETE /2.0/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
Removes a default reviewer from the repository.
repository:admin
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the username or the UUID of the default reviewer,
surrounded by curly-braces, for example: {account UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
1 2 3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}' \
--header 'Authorization: Bearer <access_token>'
The specified user successfully removed from the default reviewers
GET /2.0/repositories/{workspace}/{repo_slug}/pullrequests