/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
Adds the specified user to the project’s list of default reviewers. The method is
idempotent. Accepts an optional body containing the uuid of the user to be added.
| 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 was added as a project default reviewer
If the specified user cannot be added as 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
PUT /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}
Deletes the project group permission between the requested project and group, if one exists.
Only users with admin permission for the project may access this resource.
| 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 |
The project group permission was deleted and no content returned.
The user couldn’t be authenticated.
The requesting user isn’t an admin of the project, or the authentication method was not via app password.
One or more of the workspace, project, and group doesn’t exist for the given identifiers or the requesting user is not authenticated
DELETE /workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
/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/groups/{group_slug}
Updates the group permission, or grants a new permission if one does not already exist.
Only users with admin permission for the project may access this resource.
Due to security concerns, the JWT and OAuth authentication methods are unsupported.
This is to ensure integrations and add-ons are not allowed to change permissions.
Permissions can be:
admincreate-repowriteread| 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 |
The permission to grant
application/json
bitbucket.apps.permissions.serializers.ProjectPermissionUpdateSchema
| Property | Type | Required |
|---|---|---|
| permission | string | required |
Project group permission updated.
No permission value was provided or the value is invalid(not one of read, write, create-repo, 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 project, or the authentication method was not via app password.
One or more of the workspace, project, and group doesn’t exist for the given identifiers or the requesting user is not authenticated
PUT /workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
/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}
Deletes the project user permission between the requested project and user, if one exists.
Only users with admin permission for the project may access this resource.
Due to security concerns, the JWT and OAuth authentication methods are unsupported.
This is to ensure integrations and add-ons are not allowed to change permissions.
| 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 |
The project user permission was deleted and no content returned.
The user couldn’t be authenticated.
The requesting user isn’t an admin of the project, or the authentication method was not via app password.
One or more of the workspace, project, and selected user doesn’t exist for the given identifiers or the requesting user is not authenticated
DELETE /workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
/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}
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
Updates the explicit user permission for a given user and project. The selected
user must be a member of the workspace, and cannot be the workspace owner.
Only users with admin permission for the project may access this resource.
Due to security concerns, the JWT and OAuth authentication methods are unsupported.
This is to ensure integrations and add-ons are not allowed to change permissions.
Permissions can be:
admincreate-repowriteread| 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 |
The permission to grant
application/json
bitbucket.apps.permissions.serializers.ProjectPermissionUpdateSchema
| 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, create-repo, 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 project, or the authentication method was not via app password.
One or more of the workspace, project, and selected user doesn’t exist for the given identifiers or the requesting user is not authenticated
PUT /workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
Delete 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. |
An empty response.
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
/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}/commit/{commit}/properties/{app_key}/{property_name}
Update 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 application property to create or update.
application/json
application_property
| Property | Type | Required |
|---|---|---|
| _attributes | array | optional |
An empty response.
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
Delete 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. |
An empty response.
DELETE /repositories/{workspace}/{repo_slug}/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}/properties/{app_key}/{property_name}
Update 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 application property to create or update.
application/json
application_property
| Property | Type | Required |
|---|---|---|
| _attributes | array | optional |
An empty response.
PUT /repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
Delete 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. |
An empty response.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/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}
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
Update 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 application property to create or update.
application/json
application_property
| Property | Type | Required |
|---|---|---|
| _attributes | array | optional |
An empty response.
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
/users/{selected_user}/properties/{app_key}/{property_name}
Delete 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. |
An empty response.
DELETE /users/{selected_user}/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}
/users/{selected_user}/properties/{app_key}/{property_name}
Update 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 application property to create or update.
application/json
application_property
| Property | Type | Required |
|---|---|---|
| _attributes | array | optional |
An empty response.
PUT /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}/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}
Removes a default reviewer from 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, |
| 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 successfully removed from the default reviewers
If the authenticated user does not have access modify the default reviewers
If the specified user does not exist
DELETE /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
/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}/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.
| 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 was successfully added to the default reviewers
If the authenticated user tried to add a team, bot user, or user without access to the repository to the default reviewers
If the authenticated user does not have permission to modify the default reviewers
If the specified user does not exist
PUT /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
Creates a new pull request where the destination repository is
this repository and the author is the authenticated user.
The minimum required fields to create a pull request are title and
source, specified by a branch name.
curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repository/pullrequests \
-u my-username:my-password \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"title": "My Title",
"source": {
"branch": {
"name": "staging"
}
}
}'
If the pull request’s destination is not specified, it will default
to the repository.mainbranch. To open a pull request to a
different branch, say from a feature branch to a staging branch,
specify a destination (same format as the source):
{
"title": "My Title",
"source": {
"branch": {
"name": "my-feature-branch"
}
},
"destination": {
"branch": {
"name": "staging"
}
}
}
Reviewers can be specified by adding an array of user objects as the
reviewers property.
{
"title": "My Title",
"source": {
"branch": {
"name": "my-feature-branch"
}
},
"reviewers": [
{
"uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}"
}
]
}
Other fields:
description - a stringclose_source_branch - boolean that specifies if the source branch should be closed upon merging| Name | In | Required | Type | Description |
|---|---|---|---|---|
| repo_slug | path | required | string | This can either be the repository slug or the UUID of the repository, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The new pull request.
The request URL you POST to becomes the destination repository URL. For this reason, you must specify an explicit source repository in the request object if you want to pull from a different repository (fork).
Since not all elements are required or even mutable, you only need to include the elements you want to initialize, such as the source branch and the title.
application/json
pullrequest
| Property | Type | Required |
|---|---|---|
| type | string | required |
| id | integer | optional |
| links | object | optional |
| └ diff | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ merge | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ approve | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ decline | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ activity | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ comments | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ diffstat | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| state | string | optional |
| title | string | optional |
| author | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| reason | string | optional |
| source | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ clone | array | optional |
| └ forks | object | optional |
| └ hooks | object | optional |
| └ avatar | object | optional |
| └ commits | object | optional |
| └ watchers | object | optional |
| └ downloads | object | optional |
| └ pullrequests | object | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ target | object | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| rendered | object | optional |
| └ title | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ reason | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ description | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| closed_by | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| reviewers | array | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| created_on | string | optional |
| task_count | integer | optional |
| updated_on | string | optional |
| destination | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ clone | array | optional |
| └ forks | object | optional |
| └ hooks | object | optional |
| └ avatar | object | optional |
| └ commits | object | optional |
| └ watchers | object | optional |
| └ downloads | object | optional |
| └ pullrequests | object | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ target | object | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| merge_commit | object | optional |
| └ hash | string | optional |
| participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| comment_count | integer | optional |
| close_source_branch | boolean | optional |
The newly created pull request.
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}/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}
Mutates the specified pull request.
This can be used to change the pull request’s branches or description.
Only open pull requests can be mutated.
| 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 that is to be updated.
application/json
pullrequest
| Property | Type | Required |
|---|---|---|
| type | string | required |
| id | integer | optional |
| links | object | optional |
| └ diff | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ merge | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ approve | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ decline | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ activity | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ comments | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ diffstat | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| state | string | optional |
| title | string | optional |
| author | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| reason | string | optional |
| source | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ clone | array | optional |
| └ forks | object | optional |
| └ hooks | object | optional |
| └ avatar | object | optional |
| └ commits | object | optional |
| └ watchers | object | optional |
| └ downloads | object | optional |
| └ pullrequests | object | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ target | object | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| rendered | object | optional |
| └ title | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ reason | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ description | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| closed_by | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| reviewers | array | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| created_on | string | optional |
| task_count | integer | optional |
| updated_on | string | optional |
| destination | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ clone | array | optional |
| └ forks | object | optional |
| └ hooks | object | optional |
| └ avatar | object | optional |
| └ commits | object | optional |
| └ watchers | object | optional |
| └ downloads | object | optional |
| └ pullrequests | object | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ target | object | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| merge_commit | object | optional |
| └ hash | string | optional |
| participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| comment_count | integer | optional |
| close_source_branch | boolean | optional |
The updated pull request
If the input document was invalid.
If the request was not authenticated.
If the repository or pull request id does not exist
PUT /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}/approve
Redact the authenticated user’s approval of 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 |
An empty response indicating the authenticated user’s approval has been withdrawn.
Pull request cannot be unapproved 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}/approve
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve
Approve the specified pull request as the authenticated user.
| 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 approved the pull request.
The request wasn’t authenticated.
The specified pull request or the repository does not exist.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve
/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
Creates a new pull request comment.
Returns the newly created pull request comment.
| 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 comment object.
application/json
pullrequest_comment
| Property | Type | Required |
|---|---|---|
| type | string | required |
| id | integer | optional |
| user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| links | object | optional |
| └ code | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| inline | object | optional |
| └ to | integer | optional |
| └ from | integer | optional |
| └ path | string | required |
| parent | object | optional |
| content | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| deleted | boolean | optional |
| created_on | string | optional |
| updated_on | string | optional |
| pending | boolean | optional |
| resolution | object | optional |
| └ type | string | required |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| pullrequest | object | optional |
| └ type | string | required |
| └ id | integer | optional |
| └ links | object | optional |
| └ diff | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ merge | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ approve | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ decline | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ activity | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ comments | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ diffstat | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ state | string | optional |
| └ title | string | optional |
| └ author | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ reason | string | optional |
| └ source | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| └ summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ rendered | object | optional |
| └ title | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ reason | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ description | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ closed_by | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ reviewers | array | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| └ task_count | integer | optional |
| └ updated_on | string | optional |
| └ destination | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| └ merge_commit | object | optional |
| └ hash | string | optional |
| └ participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| └ comment_count | integer | optional |
| └ close_source_branch | boolean | optional |
The newly created comment.
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}/comments
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
Deletes 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 |
Successful deletion.
If the authenticated user does not have access to delete the comment.
If the comment does not exist.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
/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}/comments/{comment_id}
Updates 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 contents of the updated comment.
application/json
pullrequest_comment
| Property | Type | Required |
|---|---|---|
| type | string | required |
| id | integer | optional |
| user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| links | object | optional |
| └ code | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| inline | object | optional |
| └ to | integer | optional |
| └ from | integer | optional |
| └ path | string | required |
| parent | object | optional |
| content | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| deleted | boolean | optional |
| created_on | string | optional |
| updated_on | string | optional |
| pending | boolean | optional |
| resolution | object | optional |
| └ type | string | required |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| pullrequest | object | optional |
| └ type | string | required |
| └ id | integer | optional |
| └ links | object | optional |
| └ diff | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ merge | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ approve | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ decline | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ activity | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ comments | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ diffstat | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ state | string | optional |
| └ title | string | optional |
| └ author | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ reason | string | optional |
| └ source | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| └ summary | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ rendered | object | optional |
| └ title | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ reason | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ description | object | optional |
| └ raw | string | optional |
| └ html | string | optional |
| └ markup | string | optional |
| └ closed_by | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ reviewers | array | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| └ task_count | integer | optional |
| └ updated_on | string | optional |
| └ destination | object | optional |
| └ branch | object | optional |
| └ name | string | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ commit | object | optional |
| └ hash | string | optional |
| └ repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ owner | object | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| └ merge_commit | object | optional |
| └ hash | string | optional |
| └ participants | array | optional |
| └ type | string | required |
| └ role | string | optional |
| └ user | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ state | string | optional |
| └ approved | boolean | optional |
| └ participated_on | string | optional |
| └ comment_count | integer | optional |
| └ close_source_branch | boolean | optional |
The updated comment.
If the authenticated user does not have access to the comment.
If the comment does not exist.
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
| 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 is reopened.
If the authenticated user does not have access to the pull request,
or if the provided comment is not a top-level comment.
If the comment does not exist, or if the comment has not been resolved
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
| 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 resolution details.
If the authenticated user does not have access to the pull request,
if the provided comment is not a top-level comment,
or if the comment is not on the diff.
If the comment does not exist.
If the comment has already been resolved.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
/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}/decline
Declines 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 |
The pull request was successfully declined.
If the decline took too long and timed out.
In this case the caller should retry the request later.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline
/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
Merges 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 |
| async | query | optional | boolean | Default value is false. When set to true, runs merge asynchronously and When set to false, runs merge and waits for it to |
application/json
pullrequest_merge_parameters
| Property | Type | Required |
|---|---|---|
| type | string | required |
| message | string | optional |
| merge_strategy | string | optional |
| close_source_branch | boolean | optional |
The pull request object.
In the Location header, the URL to poll for the pull request merge status
If the merge took too long and timed out.
In this case the caller should retry the request later
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge
/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