List pull requests associated with a commit
Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/[email protected]/rest/reference/pulls#list-pull-requests) endpoint.
/repos/{owner}/{repo}/commits/{commit_sha}/pulls- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Path Parameters
- owner stringrequired
- repo stringrequired
- commit_sha stringrequired
commit_sha parameter
Query Parameters
- per_page integeroptional
Results per page (max 100)
- page integeroptional
Page number of the results to fetch.
Responses
Response
Headers
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last" items Pull Request Simple objectPull Request Simple
Pull Request Simple
_links objectrequired
comments Link objectrequiredHypermedia Link
Hypermedia Link
commits Link objectrequiredHypermedia Link
Hypermedia Link
html Link objectrequiredHypermedia Link
Hypermedia Link
issue Link objectrequiredHypermedia Link
Hypermedia Link
review_comment Link objectrequiredHypermedia Link
Hypermedia Link
review_comments Link objectrequiredHypermedia Link
Hypermedia Link
self Link objectrequiredHypermedia Link
Hypermedia Link
statuses Link objectrequiredHypermedia Link
Hypermedia Link
Example: too heated
assignee Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
assignees array[Simple User object]optionalnullable
items Simple User objectSimple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
How the author is associated with the repository.
Example: OWNER
base objectrequired
repo Repository objectrequiredA git repository
A git repository
Whether to allow forking this repo
Whether to allow merge commits for pull requests.
Example: true
Whether to allow rebase merges for pull requests.
Example: true
Whether to allow squash merges for pull requests.
Example: true
Example: http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}
Whether the repository is archived.
Example: http://api.github.com/repos/octocat/Hello-World/assignees{/user}
Example: http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/branches{/branch}
Example: https://github.com/octocat/Hello-World.git
Example: http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}
Example: http://api.github.com/repos/octocat/Hello-World/comments{/number}
Example: http://api.github.com/repos/octocat/Hello-World/commits{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}
Example: http://api.github.com/repos/octocat/Hello-World/contents/{+path}
Example: http://api.github.com/repos/octocat/Hello-World/contributors
Example: 2011-01-26T19:01:12Z
The default branch of the repository.
Example: master
Whether to delete head branches when pull requests are merged
Example: false
Example: http://api.github.com/repos/octocat/Hello-World/deployments
Example: This your first repo!
Returns whether or not this repository disabled.
Example: http://api.github.com/repos/octocat/Hello-World/downloads
Example: http://api.github.com/repos/octocat/Hello-World/events
Example: 9
Example: http://api.github.com/repos/octocat/Hello-World/forks
Example: octocat/Hello-World
Example: http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}
Example: git:github.com/octocat/Hello-World.git
Whether downloads are enabled.
Example: true
Whether issues are enabled.
Example: true
Whether projects are enabled.
Example: true
Whether the wiki is enabled.
Example: true
Example: https://github.com
Example: http://api.github.com/repos/octocat/Hello-World/hooks
Example: https://github.com/octocat/Hello-World
Unique identifier of the repository
Example: 42
Whether this repository acts as a template that can be used to generate new repositories.
Example: true
Example: http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}
Example: http://api.github.com/repos/octocat/Hello-World/issues/events{/number}
Example: http://api.github.com/repos/octocat/Hello-World/issues{/number}
Example: http://api.github.com/repos/octocat/Hello-World/keys{/key_id}
Example: http://api.github.com/repos/octocat/Hello-World/labels{/name}
Example: http://api.github.com/repos/octocat/Hello-World/languages
License Simple
Example: http://api.github.com/repos/octocat/Hello-World/merges
Example: http://api.github.com/repos/octocat/Hello-World/milestones{/number}
Example: git:git.example.com/octocat/Hello-World
The name of the repository.
Example: Team Environment
Example: MDEwOlJlcG9zaXRvcnkxMjk2MjY5
Example: http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}
Example: 0
Simple User
Simple User
Whether the repository is private or public.
Example: http://api.github.com/repos/octocat/Hello-World/pulls{/number}
Example: 2011-01-26T19:06:43Z
Example: http://api.github.com/repos/octocat/Hello-World/releases{/id}
Example: 108
Example: [email protected]:octocat/Hello-World.git
Example: 80
Example: http://api.github.com/repos/octocat/Hello-World/stargazers
Example: "2020-07-09T00:17:42Z"
Example: http://api.github.com/repos/octocat/Hello-World/statuses/{sha}
Example: http://api.github.com/repos/octocat/Hello-World/subscribers
Example: http://api.github.com/repos/octocat/Hello-World/subscription
Example: https://svn.github.com/octocat/Hello-World
Example: http://api.github.com/repos/octocat/Hello-World/tags
Example: http://api.github.com/repos/octocat/Hello-World/teams
Example: http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}
Example: 2011-01-26T19:14:43Z
Example: https://api.github.com/repos/octocat/Hello-World
The repository visibility: public, private, or internal.
Example: 80
user Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
Example: Please pull these awesome changes
Example: 2011-01-26T19:01:12Z
Example: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments
Example: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits
Example: 2011-01-26T19:01:12Z
Example: https://github.com/octocat/Hello-World/pull/1347.diff
Indicates whether or not the pull request is a draft.
Example: false
head objectrequired
repo Repository objectrequiredA git repository
A git repository
Whether to allow forking this repo
Whether to allow merge commits for pull requests.
Example: true
Whether to allow rebase merges for pull requests.
Example: true
Whether to allow squash merges for pull requests.
Example: true
Example: http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}
Whether the repository is archived.
Example: http://api.github.com/repos/octocat/Hello-World/assignees{/user}
Example: http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/branches{/branch}
Example: https://github.com/octocat/Hello-World.git
Example: http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}
Example: http://api.github.com/repos/octocat/Hello-World/comments{/number}
Example: http://api.github.com/repos/octocat/Hello-World/commits{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}
Example: http://api.github.com/repos/octocat/Hello-World/contents/{+path}
Example: http://api.github.com/repos/octocat/Hello-World/contributors
Example: 2011-01-26T19:01:12Z
The default branch of the repository.
Example: master
Whether to delete head branches when pull requests are merged
Example: false
Example: http://api.github.com/repos/octocat/Hello-World/deployments
Example: This your first repo!
Returns whether or not this repository disabled.
Example: http://api.github.com/repos/octocat/Hello-World/downloads
Example: http://api.github.com/repos/octocat/Hello-World/events
Example: 9
Example: http://api.github.com/repos/octocat/Hello-World/forks
Example: octocat/Hello-World
Example: http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}
Example: git:github.com/octocat/Hello-World.git
Whether downloads are enabled.
Example: true
Whether issues are enabled.
Example: true
Whether projects are enabled.
Example: true
Whether the wiki is enabled.
Example: true
Example: https://github.com
Example: http://api.github.com/repos/octocat/Hello-World/hooks
Example: https://github.com/octocat/Hello-World
Unique identifier of the repository
Example: 42
Whether this repository acts as a template that can be used to generate new repositories.
Example: true
Example: http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}
Example: http://api.github.com/repos/octocat/Hello-World/issues/events{/number}
Example: http://api.github.com/repos/octocat/Hello-World/issues{/number}
Example: http://api.github.com/repos/octocat/Hello-World/keys{/key_id}
Example: http://api.github.com/repos/octocat/Hello-World/labels{/name}
Example: http://api.github.com/repos/octocat/Hello-World/languages
License Simple
Example: http://api.github.com/repos/octocat/Hello-World/merges
Example: http://api.github.com/repos/octocat/Hello-World/milestones{/number}
Example: git:git.example.com/octocat/Hello-World
The name of the repository.
Example: Team Environment
Example: MDEwOlJlcG9zaXRvcnkxMjk2MjY5
Example: http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}
Example: 0
Simple User
Simple User
Whether the repository is private or public.
Example: http://api.github.com/repos/octocat/Hello-World/pulls{/number}
Example: 2011-01-26T19:06:43Z
Example: http://api.github.com/repos/octocat/Hello-World/releases{/id}
Example: 108
Example: [email protected]:octocat/Hello-World.git
Example: 80
Example: http://api.github.com/repos/octocat/Hello-World/stargazers
Example: "2020-07-09T00:17:42Z"
Example: http://api.github.com/repos/octocat/Hello-World/statuses/{sha}
Example: http://api.github.com/repos/octocat/Hello-World/subscribers
Example: http://api.github.com/repos/octocat/Hello-World/subscription
Example: https://svn.github.com/octocat/Hello-World
Example: http://api.github.com/repos/octocat/Hello-World/tags
Example: http://api.github.com/repos/octocat/Hello-World/teams
Example: http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}
Example: 2011-01-26T19:14:43Z
Example: https://api.github.com/repos/octocat/Hello-World
The repository visibility: public, private, or internal.
Example: 80
user Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
Example: https://github.com/octocat/Hello-World/pull/1347
Example: 1
Example: https://api.github.com/repos/octocat/Hello-World/issues/1347
labels array[object]required
items object
Example: true
Example: e5bd3914e2e596debea16f433f57875b5b90bcd6
Example: 2011-01-26T19:01:12Z
milestone Milestone objectrequirednullable A collection of related issues and pull requests.
A collection of related issues and pull requests.
Example: 2013-02-12T13:22:01Z
Example: 8
Example: 2011-04-10T20:09:31Z
creator Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
Example: Tracking milestone for version 1.0
Example: 2012-10-09T23:39:01Z
Example: https://github.com/octocat/Hello-World/milestones/v1.0
Example: 1002604
Example: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels
Example: MDk6TWlsZXN0b25lMTAwMjYwNA==
The number of the milestone.
Example: 42
Example: 4
The state of the milestone.
Example: open
The title of the milestone.
Example: v1.0
Example: 2014-03-03T18:58:10Z
Example: https://api.github.com/repos/octocat/Hello-World/milestones/1
Example: MDExOlB1bGxSZXF1ZXN0MQ==
Example: 1347
Example: https://github.com/octocat/Hello-World/pull/1347.patch
requested_reviewers array[Simple User object]optionalnullable
items Simple User objectSimple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
requested_teams array[Team object]optionalnullable
items Team objectGroups of organization members that gives permissions on specified repositories.
Groups of organization members that gives permissions on specified repositories.
Example: https://github.com/orgs/rails/teams/core
Groups of organization members that gives permissions on specified repositories.
Example: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}
Example: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments
Example: open
https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5eExample: new-feature
Example: 2011-01-26T19:01:12Z
Example: https://api.github.com/repos/octocat/Hello-World/pulls/1347
user Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat