Merge a pull request
Merges a pull request into the base branch. This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see “Rate limits for the API” and “Best practices for using the REST API.”
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
The number that identifies the pull request.
Request Body
Section titled “ Request Body ”object
Title for the automatic commit message.
Extra detail to append to automatic commit message.
SHA that pull request head must match to allow merge.
The merge method to use.
Examples
{ "commit_title": "Expand enum", "commit_message": "Add a new value to the merge_method enum"}Responses
Section titled “ Responses ”If merge was successful
Pull Request Merge Result
object
Examples
{ "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", "merged": true, "message": "Pull Request successfully merged"}Forbidden
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Resource not found
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Method Not Allowed if merge cannot be performed
object
Examples
{ "message": "Pull Request is not mergeable"}Conflict if sha was provided and pull request head did not match
object
Examples
{ "message": "Head branch was modified. Review and try the merge again."}Validation failed, or the endpoint has been spammed.
Validation Error
object
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ { "resource": "example", "field": "example", "message": "example", "code": "example", "index": 1, "value": [ "example" ] } ]}