GitHub v3 REST API

List commits on a pull request

Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the List commits endpoint.

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/commits

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired

Response

200 application/json

Response

Commit

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e

shastringrequired

Example:6dcb09b5b57875f334f61aebed695e2e4193db5e

node_idstringrequired

Example:MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==

html_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e

comments_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments

commitobjectrequired
Show Child Parameters
authorobject | nullrequired

Simple User

Show Child Parameters
committerobject | nullrequired

Simple User

Show Child Parameters
parentsarray[object]required
Show Child Parameters
statsobject
Show Child Parameters
filesarray[object]

Diff Entry

Show Child Parameters
get/repos/{owner}/{repo}/pulls/{pull_number}/commits
 
200 application/json

List pull requests files

Note: Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/files

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired

Response

application/json

Response

Diff Entry

shastringrequired

Example:bbcd538c8e72b8c175046e27cc8f907076331401

filenamestringrequired

Example:file1.txt

statusstringrequired

Allowed values:addedremovedmodifiedrenamedcopiedchangedunchanged

Example:added

additionsintegerrequired

Example:103

deletionsintegerrequired

Example:21

changesintegerrequired

Example:124

blob_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt

raw_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt

contents_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e

patchstring

Example:@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test

previous_filenamestring

Example:file.txt

get/repos/{owner}/{repo}/pulls/{pull_number}/files
 
application/json

Check if a pull request has been merged

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/merge

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired

Response

Response if pull request has been merged

get/repos/{owner}/{repo}/pulls/{pull_number}/merge
 

Merge a 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.

put
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/merge

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired

Body

application/json
commit_titlestring

Title for the automatic commit message.

commit_messagestring

Extra detail to append to automatic commit message.

shastring

SHA that pull request head must match to allow merge.

merge_methodstring

Merge method to use. Possible values are merge, squash or rebase. Default is merge.

Allowed values:mergesquashrebase

Response

application/json

if merge was successful

Pull Request Merge Result

Pull Request Merge Result

shastringrequired
mergedbooleanrequired
messagestringrequired
put/repos/{owner}/{repo}/pulls/{pull_number}/merge

Body

{}
 
application/json

List requested reviewers for a pull request

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired

Response

200 application/json

Response

Pull Request Review Request

Pull Request Review Request

usersarray[object]required

Simple User

Show Child Parameters
teamsarray[object]required

Groups of organization members that gives permissions on specified repositories.

Show Child Parameters
get/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers
 
200 application/json