Docs
Sign in

Merge a pull request.

An approval action: the session, or a key the founder gave approve.

POST/api/v1/pull-requests/{id}/merge

Scopeapprove

headSha is the head commit that was reviewed; the merge is refused if the pull request has moved since. Reads GitHub first and answers 409 not_mergeable (the reasons in details) unless it is open, not a draft, mergeable and its checks are neither failing nor pending. Merges with a merge commit and records the approval and who gave it. Idempotent: an already merged pull request answers merged: true, alreadyMerged: true. When an API key calls it, the timeline records who did what and the outcome. No query parameters.

Path parameters.

idstringrequired

The pull request's id.

Headers.

Idempotency-Keystring

Makes a retry safe: the same key with the same request returns the first answer and does nothing else.

Body.

approvetruerequired

The founder's explicit approval.

headShastringrequired

The head commit the founder reviewed; the merge is refused if the PR has moved since. Matches ^[0-9a-f]{40}$.

Response.

200 OK: a JSON object. The example has placeholder values.

422 validation_failed
The body does not match its schema; each problem is in details.