Skip to main content

pull_requests

Overview

Namepull_requests
TypeResource
Idgithub.pulls.pull_requests

Fields

NameDatatypeDescription
idinteger
requested_teamsarray
merged_atstring
lockedboolean
numberintegerNumber uniquely identifying the pull request within its repository.
created_atstring
review_commentsinteger
assigneeobjectSimple User
requested_reviewersarray
commitsinteger
additionsinteger
review_comments_urlstring
maintainer_can_modifybooleanIndicates whether maintainers can modify the pull request.
assigneesarray
mergeable_statestring
commits_urlstring
review_comment_urlstring
rebaseableboolean
deletionsinteger
auto_mergeobjectThe status of auto merging a pull request.
merge_commit_shastring
mergedboolean
urlstring
headobject
updated_atstring
labelsarray
bodystring
issue_urlstring
merged_byobjectSimple User
titlestringThe title of the pull request.
_linksobject
draftbooleanIndicates whether or not the pull request is a draft.
commentsinteger
statuses_urlstring
patch_urlstring
author_associationstringHow the author is associated with the repository.
mergeableboolean
baseobject
diff_urlstring
node_idstring
comments_urlstring
changed_filesinteger
userobjectSimple User
active_lock_reasonstring
html_urlstring
statestringState of this Pull Request. Either open or closed.
milestoneobjectA collection of related issues and pull requests.
closed_atstring

Methods

NameAccessible byRequired ParamsDescription
getSELECTowner, pull_number, repoDraft 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.

Lists details of a pull request by providing its number.

When you get, create, or edit a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the mergeable key. For more information, see "Checking mergeability of pull requests".

The value of the mergeable attribute can be true, false, or null. If the value is null, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-null value for the mergeable attribute in the response. If mergeable is true, then merge_commit_sha will be the SHA of the test merge commit.

The value of the merge_commit_sha attribute changes depending on the state of the pull request. Before merging a pull request, the merge_commit_sha attribute holds the SHA of the test merge commit. After merging a pull request, the merge_commit_sha attribute changes depending on how you merged the pull request:

If merged as a merge commit, merge_commit_sha represents the SHA of the merge commit.
If merged via a squash, merge_commit_sha represents the SHA of the squashed commit on the base branch.
* If rebased, merge_commit_sha represents the commit that the base branch was updated to.

Pass the appropriate media type to fetch diff and patch formats.
listSELECTowner, repoDraft 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.
createINSERTowner, repo, data__base, data__headDraft 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.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.

You can create a new pull request.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.
check_if_mergedEXECowner, pull_number, repo
mergeEXECowner, pull_number, repoThis endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.
updateEXECowner, pull_number, repoDraft 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.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.
update_branchEXECowner, pull_number, repoUpdates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.