Create a pull request
Changed onCreates 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 string
- close_source_branch - boolean that specifies if the source branch should be closed upon merging
- draft - boolean that specifies whether the pull request is a draft
Request
- Base URLhttps://api.bitbucket.org/2.0
- URLhttps://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests
- Auth
- OAuth 2Authorization code: https://bitbucket.org/site/oauth2/authorizeToken URL: https://bitbucket.org/site/oauth2/access_token scopes: pullrequest:write
- or HTTP basic
- or API key in header Authorization
Request body
Response
The newly created pull request.
Changes
- info
added the new optional request property
// - info
added the optional property
//to the response with the status
- info
- warning
removed the request property
/// - warning
removed the request property
/// - warning
removed the request property
//////////////// - warning
removed the request property
///////////// - warning
removed the request property
////// - warning
removed the request property
//////////// - warning
removed the request property
////// - warning
removed the request property
//// - warning
removed the request property
//////////////// - warning
removed the request property
///////////// - warning
removed the request property
////// - warning
removed the request property
//////////// - warning
removed the optional property
///from the response with the status - warning
removed the optional property
///from the response with the status - warning
removed the optional property
////////////////from the response with the status - warning
removed the optional property
/////////////from the response with the status - warning
removed the optional property
//////from the response with the status - warning
removed the optional property
////////////from the response with the status - warning
removed the optional property
//////from the response with the status - warning
removed the optional property
////from the response with the status - warning
removed the optional property
////////////////from the response with the status - warning
removed the optional property
/////////////from the response with the status - warning
removed the optional property
//////from the response with the status - warning
removed the optional property
////////////from the response with the status - warning
added the new
rebase_fast_forwardenum value to the////response property for the response status - warning
added the new
rebase_fast_forwardenum value to the///////response property for the response status - warning
added the new
rebase_fast_forwardenum value to the////response property for the response status - warning
added the new
rebase_fast_forwardenum value to the///////response property for the response status - warning
added the new
rebase_mergeenum value to the////response property for the response status - warning
added the new
rebase_mergeenum value to the///////response property for the response status - warning
added the new
rebase_mergeenum value to the////response property for the response status - warning
added the new
rebase_mergeenum value to the///////response property for the response status - warning
added the new
squash_fast_forwardenum value to the////response property for the response status - warning
added the new
squash_fast_forwardenum value to the///////response property for the response status - warning
added the new
squash_fast_forwardenum value to the////response property for the response status - warning
added the new
squash_fast_forwardenum value to the///////response property for the response status - info
added the new optional request property
//////////// - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the new optional request property
//////////// - info
added the new
rebase_fast_forwardenum value to the request property//// - info
added the new
rebase_fast_forwardenum value to the request property/////// - info
added the new
rebase_fast_forwardenum value to the request property//// - info
added the new
rebase_fast_forwardenum value to the request property/////// - info
added the new
rebase_mergeenum value to the request property//// - info
added the new
rebase_mergeenum value to the request property/////// - info
added the new
rebase_mergeenum value to the request property//// - info
added the new
rebase_mergeenum value to the request property/////// - info
added the new
squash_fast_forwardenum value to the request property//// - info
added the new
squash_fast_forwardenum value to the request property/////// - info
added the new
squash_fast_forwardenum value to the request property//// - info
added the new
squash_fast_forwardenum value to the request property/////// - info
added the optional property
////////////to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
////////////to the response with the status
- warning