Skip to main content
POST
Merge a pull request

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

pullRequestID
string<uuid>
required

Body

application/json
expected_head_sha
string
required

the exact 40-character lowercase head commit SHA the user reviewed; GitHub refuses the merge if the PR head has moved past it

Required string length: 40
Pattern: ^[0-9a-f]{40}$
expected_pr_number
integer<int64>
required

the number of the pull request the user reviewed; the merge is refused with 409 if the task's primary published pull request is no longer this one

Required range: x >= 1
idempotency_key
string
required

client-generated stable key for this merge; a retry with the same key replays the first result without merging again

Minimum string length: 8
method
enum<string>
required

GitHub's merge method: squash, rebase, or merge (a merge commit). A method the repository's settings disallow is refused with 422 carrying GitHub's message.

Available options:
squash,
rebase,
merge
delete_branch
boolean

True: delete the head branch once the merge succeeds, and only while it still points at the merged head; a branch a push moved is kept and answered with 409 naming the merge commit. Refused with 422 fork_branch_delete_unsupported before merging when the head branch lives in a fork. False or omitted: the branch stays.

Response

OK

sha
string
required
Minimum string length: 1