/repos/{owner}/{repo}/pulls/{pull_number}/merge-asyncMerge a pull request asynchronously
Merges a pull request into the base branch in the background or adds it to a merge queue. Background processing allows certain types of errors to be retried and reduces the risk of timeouts for complex merges.
This is the required API for merging stacked pull requests. For a stacked pull request, the operation includes all open downstack pull requests.
A new asynchronous merge request returns a 202 response with a UUID that can be used to fetch the result of the merge. If another asynchronous merge request is already pending for this pull request, a 409 response returns that request's UUID and merge options instead.
If the pull request is already merged or already in a merge queue, a 200 response is returned immediately. A merged result includes the merge commit OID. An enqueued result means the pull request was added to the merge queue, not that it has merged.
If the pull request cannot be merged (e.g. because it is closed, or still a draft) this result will be returned immediately with a 400 response status. Branch protection rules and repository rules are not run at this stage, only basic pull request state checks are performed.
A 400 is returned: if the pull request is not ready to be merged, e.g. because it is closed. A 403 is returned: Forbidden. A 404 is returned: Resource not found. A 409 is returned: if there is an existing merge request already enqueued for this pull request. A 422 is returned: Validation failed, or the endpoint has been spammed.