API
Pull requests
Open, comment on, merge and close pull requests.
See Pull requests.
Every route below, with its parameters, request and response, errors and samples, is in the API reference.
| Route | What it does |
|---|---|
GET /v1/orgs/:orgId/repos/:name/pulls/:number/review | Inline review comments with their file and line, approvals, and how many approvals the pull request still needs. |
POST /v1/orgs/:orgId/repos/:name/pulls/:number/review/comments | Adds a review comment: a new thread on a line of the diff (path, line, side), or a reply (inReplyTo). |
POST /v1/orgs/:orgId/repos/:name/pulls/:number/approval | Approves the pull request's current revision, or withdraws your approval. Authors can't approve their own. |
POST /v1/orgs/:orgId/repos/:name/pulls/:number/reopen | CodeCommit can't reopen a closed pull request; a new one replaces it under the same number. |
GET /v1/orgs/:orgId/repos/:name/pulls | Lists pull requests in one state, newest first. Listing open pull requests also settles any that were merged or closed outside the portal. |
POST /v1/orgs/:orgId/repos/:name/pulls | Opens a pull request that merges source into target. |
GET /v1/orgs/:orgId/repos/:name/pulls/:number | A pull request with its commit range, the merge strategies available now, its comments, and codeowners: the owners each changed path needs an approval from (null without a CODEOWNERS file). |
PATCH /v1/orgs/:orgId/repos/:name/pulls/:number | Changes a pull request's title, description, labels or assignees. |
GET /v1/orgs/:orgId/repos/:name/pulls/:number/commits | Commits the pull request adds to its target. |
GET /v1/orgs/:orgId/repos/:name/pulls/:number/files | Changed files with unified diffs. |
POST /v1/orgs/:orgId/repos/:name/pulls/:number/merge | Merges the pull request. Pass sourceCommitId (the head you reviewed) to fail if the branch has moved since. Into a ruled branch it needs the rule's approvals and code owner reviews (409 otherwise) and a clean secret scan (422); bypass: true merges without the reviews for people on the bypass list, audited. |
POST /v1/orgs/:orgId/repos/:name/pulls/:number/close | Closes the pull request without merging. |
POST /v1/orgs/:orgId/repos/:name/pulls/:number/comments | Adds a comment to a pull request. |