Interact with GitHub Pull Requests.
27 endpoints tagged pulls, each listing its
parameters and possible responses. Search or scroll the index below to
jump to a specific endpoint.
No endpoints match your search.
GET /repos/{owner}/{repo}/pulls
Lists pull requests in a specified repository.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
state | query | no | Either open, closed, or all to filter by state. |
head | query | no | Filter pulls by head user or head organization and branch name in the format of user:ref-name or organization:ref-name. For example: github:new-script-format or octocat:test-branch. |
base | query | no | Filter pulls by base branch name. Example: gh-pages. |
sort | query | no | What to sort results by. popularity will sort by the number of comments. long-running will sort by date created and will limit the results to pull requests that have been open for more than a month and have had activity within the past month. |
direction | query | no | The direction of the sort. Default: desc when sort is created or sort is not specified, otherwise asc. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
POST /repos/{owner}/{repo}/pulls
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 403 | Forbidden | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
GET /repos/{owner}/{repo}/pulls/comments
Lists review comments for all pull requests in a repository. By default,
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
sort | query | no | |
direction | query | no | The direction to sort results. Ignored without sort parameter. |
since | query | no | Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
GET /repos/{owner}/{repo}/pulls/comments/{comment_id}
Provides details for a specified review comment.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
comment_id | path | yes | The unique identifier of the comment. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}
Edits the content of a specified review comment.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
comment_id | path | yes | The unique identifier of the comment. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}
Deletes a review comment.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
comment_id | path | yes | The unique identifier of the comment. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 404 | Resource not found | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Pass the appropriate media type to fetch diff and patch formats. | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 406 | Unacceptable | yes |
| 500 | Internal Error | yes |
| 503 | Service unavailable | yes |
PATCH /repos/{owner}/{repo}/pulls/{pull_number}
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/comments
Lists all review comments for a specified pull request. By default, review comments
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
sort | query | no | The property to sort the results by. |
direction | query | no | The direction to sort results. Ignored without sort parameter. |
since | query | no | Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
POST /repos/{owner}/{repo}/pulls/{pull_number}/comments
Creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "Create an issue comment."
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |
POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies
Creates a reply to a review comment for a pull request. For the comment_id, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
comment_id | path | yes | The unique identifier of the comment. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 404 | Resource not found | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/commits
Lists a maximum of 250 commits for a pull request. To receive a complete
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/files
Lists the files in a specified pull request.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 500 | Internal Error | yes |
| 503 | Service unavailable | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/merge
Checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response if pull request has been merged | no |
| 404 | Not Found if pull request has not been merged | no |
PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge
Merges a pull request into the base branch.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | if merge was successful | yes |
| 405 | Method Not Allowed if merge cannot be performed | yes |
| 409 | Conflict if sha was provided and pull request head did not match | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers
Gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the List reviews for a pull request operation.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers
Requests reviews for a pull request from a given set of users and/or teams.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Unprocessable Entity if user is not a collaborator | no |
| 403 | Forbidden | yes |
DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers
Removes review requests from a pull request for a given set of users and/or teams.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews
Lists all reviews for a specified pull request. The list of reviews returns in chronological order.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | The list of reviews returns in chronological order. | yes |
POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews
Creates a review on a specified pull request.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}
Retrieves a pull request review by its ID.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
review_id | path | yes | The unique identifier of the review. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}
Updates the contents of a specified review summary comment.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
review_id | path | yes | The unique identifier of the review. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}
Deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
review_id | path | yes | The unique identifier of the review. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 404 | Resource not found | yes |
GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments
Lists comments for a specific pull request review.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
review_id | path | yes | The unique identifier of the review. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals
Dismisses a specified review on a pull request.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
review_id | path | yes | The unique identifier of the review. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events
Submits a pending review for a pull request. For more information about creating a pending review for a pull request, see "Create a review for a pull request."
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
review_id | path | yes | The unique identifier of the review. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |
PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch
Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
pull_number | path | yes | The number that identifies the pull request. |
| Status | Description | Has JSON body |
|---|---|---|
| 202 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |