Merge a pull request
Merges the pull request.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The id of the pull request.
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.
Query Parameters
Section titled “ Query Parameters ”Default value is false.
When set to true, runs merge asynchronously and immediately returns a 202 with polling link to the task-status API in the Location header.
When set to false, runs merge and waits for it to complete, returning 200 when it succeeds. If the duration of the merge exceeds a timeout threshold, the API returns a 202 with polling link to the task-status API in the Location header.
Request Body
Section titled “ Request Body ”The metadata that describes a pull request merge.
object
The commit message that will be used on the resulting commit. Note that the size of the message is limited to 128 KiB.
Whether the source branch should be deleted. If this is not provided, we fallback to the value used when the pull request was created, which defaults to False
The merge strategy that will be used to merge the pull request.
Responses
Section titled “ Responses ”The pull request object.
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The pull request’s unique ID. Note that pull request IDs are only unique within their associated repository.
Title of the pull request.
User provided pull request text, interpreted in a markup language and rendered in HTML
object
object
The text as it was typed by a user.
The type of markup language the raw content is to be interpreted in.
The user’s content rendered as HTML.
object
The text as it was typed by a user.
The type of markup language the raw content is to be interpreted in.
The user’s content rendered as HTML.
object
The text as it was typed by a user.
The type of markup language the raw content is to be interpreted in.
The user’s content rendered as HTML.
object
The text as it was typed by a user.
The type of markup language the raw content is to be interpreted in.
The user’s content rendered as HTML.
The pull request’s current status.
object
Links related to an Account.
object
A link to a resource related to this object.
object
object
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The repository’s immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.
The concatenation of the repository owner’s username and the slugified name, e.g. “evzijst/interruptingcow”. This is the same string used in Bitbucket URLs.
object
Links related to an Account.
object
A link to a resource related to this object.
object
The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.
The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com.
Controls the rules for forking this repository.
- allow_forks: unrestricted forking
- no_public_forks: restrict forking to private forks (forks cannot be made public later)
- no_forks: deny all forking
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The project’s immutable id.
The project’s key.
object
Links related to an Account.
object
A link to a resource related to this object.
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The name of the project.
Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.
Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The name of the ref.
object
object
The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
object
Links related to an Account.
object
A link to a resource related to this object.
object
object
The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
object
Links related to an Account.
object
A link to a resource related to this object.
object
object
The text as it was typed by a user.
The type of markup language the raw content is to be interpreted in.
The user’s content rendered as HTML.
object
object
Links related to an Account.
object
A link to a resource related to this object.
object
The ISO8601 timestamp of the participant’s action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.
Available merge strategies for pull requests targeting this branch.
The default merge strategy for pull requests targeting this branch.
object
Available merge strategies, when this endpoint is the destination of the pull request.
The default merge strategy, when this endpoint is the destination of the pull request.
object
object
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The repository’s immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.
The concatenation of the repository owner’s username and the slugified name, e.g. “evzijst/interruptingcow”. This is the same string used in Bitbucket URLs.
object
Links related to an Account.
object
A link to a resource related to this object.
object
The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.
The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com.
Controls the rules for forking this repository.
- allow_forks: unrestricted forking
- no_public_forks: restrict forking to private forks (forks cannot be made public later)
- no_forks: deny all forking
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The project’s immutable id.
The project’s key.
object
Links related to an Account.
object
A link to a resource related to this object.
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The name of the project.
Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.
Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.
object
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
A link to a resource related to this object.
object
The name of the ref.
object
object
The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
object
Links related to an Account.
object
A link to a resource related to this object.
object
object
The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
object
Links related to an Account.
object
A link to a resource related to this object.
object
object
The text as it was typed by a user.
The type of markup language the raw content is to be interpreted in.
The user’s content rendered as HTML.
object
object
Links related to an Account.
object
A link to a resource related to this object.
object
The ISO8601 timestamp of the participant’s action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.
Available merge strategies for pull requests targeting this branch.
The default merge strategy for pull requests targeting this branch.
object
Available merge strategies, when this endpoint is the destination of the pull request.
The default merge strategy, when this endpoint is the destination of the pull request.
object
object
The number of comments for a specific pull request.
The number of open tasks for a specific pull request.
A boolean flag indicating if merging the pull request closes the source branch.
object
Links related to an Account.
object
A link to a resource related to this object.
object
Explains why a pull request was declined. This field is only applicable to pull requests in rejected state.
The ISO8601 timestamp the request was created.
The ISO8601 timestamp the request was last updated.
The list of users that were added as reviewers on this pull request when it was created. For performance reasons, the API only includes this list on a pull request’s self URL.
object
Links related to an Account.
object
A link to a resource related to this object.
object
The list of users that are collaborating on this pull request.
Collaborators are user that:
* are added to the pull request as a reviewer (part of the reviewers
list)
* are not explicit reviewers, but have commented on the pull request
* are not explicit reviewers, but have approved the pull request
Each user is wrapped in an object that indicates the user's role and
whether they have approved the pull request. For performance reasons,
the API only returns this list when an API requests a pull request by
id.
object
object
Links related to an Account.
object
A link to a resource related to this object.
object
The ISO8601 timestamp of the participant’s action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.
A boolean flag indicating whether the pull request is a draft.
A boolean flag indicating whether the pull request is queued
Example
{ "rendered": { "title": { "markup": "markdown" }, "description": { "markup": "markdown" }, "reason": { "markup": "markdown" } }, "summary": { "markup": "markdown" }, "state": "OPEN", "source": { "repository": { "scm": "git", "fork_policy": "allow_forks", "mainbranch": { "target": { "summary": { "markup": "markdown" }, "participants": [ { "role": "PARTICIPANT", "state": "approved" } ] }, "merge_strategies": [ "merge_commit" ] } }, "branch": { "merge_strategies": [ "merge_commit" ] } }, "destination": { "repository": { "scm": "git", "fork_policy": "allow_forks", "mainbranch": { "target": { "summary": { "markup": "markdown" }, "participants": [ { "role": "PARTICIPANT", "state": "approved" } ] }, "merge_strategies": [ "merge_commit" ] } }, "branch": { "merge_strategies": [ "merge_commit" ] } }, "participants": [ { "role": "PARTICIPANT", "state": "approved" } ]}In the Location header, the URL to poll for the pull request merge status
Unable to merge because one of the refs involved changed while attempting to merge
If the merge took too long and timed out. In this case the caller should retry the request later
Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.
object
object
Optional structured data that is endpoint-specific.
object
Example generated
{ "type": "example", "error": { "message": "example", "detail": "example", "data": {} }}