GitHub v3 REST API

List reviews for a pull request

The list of reviews returns in chronological order.

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

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

The list of reviews returns in chronological order.

Pull Request Reviews are reviews on pull requests.

idintegerrequired

Unique identifier of the review

Example:42

node_idstringrequired

Example:MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=

userobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The text of the review.

Example:This looks great.

statestringrequired

Example:CHANGES_REQUESTED

html_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80

pull_request_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/pulls/12

_linksobjectrequired
Show Child Parameters
submitted_atstring(date-time)
commit_idstringrequired

A commit SHA for the review.

Example:54bb654c9e6025347f57900a4a5c2313a96b8035

body_htmlstring
body_textstring
author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

get/repos/{owner}/{repo}/pulls/{pull_number}/reviews
 
200 application/json

Create a review for 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.

Pull request reviews created in the PENDING state do not include the submitted_at property in the response.

Note: To comment on a specific line in a file, you need to first determine the position of that line in the diff. The GitHub REST API v3 offers the application/vnd.github.v3.diff media type. To see a pull request diff, add this media type to the Accept header of a call to the single pull request endpoint.

The position value equals the number of lines down from the first “@@” hunk header in the file you want to add a comment. The line just below the “@@” line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.

post
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/reviews

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired

Body

application/json
commit_idstring

The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the position. Defaults to the most recent commit in the pull request when you do not specify a value.

bodystring

Required when using REQUEST_CHANGES or COMMENT for the event parameter. The body text of the pull request review.

eventstring

The review action you want to perform. The review actions include: APPROVE, REQUEST_CHANGES, or COMMENT. By leaving this blank, you set the review action state to PENDING, which means you will need to submit the pull request review when you are ready.

Allowed values:APPROVEREQUEST_CHANGESCOMMENT

commentsarray[object]

Use the following table to specify the location, destination, and contents of the draft review comment.

Show Child Parameters

Response

application/json

Response

Pull Request Review

Pull Request Reviews are reviews on pull requests.

idintegerrequired

Unique identifier of the review

Example:42

node_idstringrequired

Example:MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=

userobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The text of the review.

Example:This looks great.

statestringrequired

Example:CHANGES_REQUESTED

html_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80

pull_request_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/pulls/12

_linksobjectrequired
Show Child Parameters
submitted_atstring(date-time)
commit_idstringrequired

A commit SHA for the review.

Example:54bb654c9e6025347f57900a4a5c2313a96b8035

body_htmlstring
body_textstring
author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

post/repos/{owner}/{repo}/pulls/{pull_number}/reviews

Body

{ "commit_id": "ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091", "body": "This is close to perfect! Please address the suggested inline change.", "event": "REQUEST_CHANGES", "comments": [ { "path": "file.md", "position": 6, "body": "Please add more information here, and fix this typo." } ] }
 
application/json

Get a review for a pull request

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

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired
review_idintegerrequired

review_id parameter

Response

application/json

Response

Pull Request Review

Pull Request Reviews are reviews on pull requests.

idintegerrequired

Unique identifier of the review

Example:42

node_idstringrequired

Example:MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=

userobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The text of the review.

Example:This looks great.

statestringrequired

Example:CHANGES_REQUESTED

html_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80

pull_request_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/pulls/12

_linksobjectrequired
Show Child Parameters
submitted_atstring(date-time)
commit_idstringrequired

A commit SHA for the review.

Example:54bb654c9e6025347f57900a4a5c2313a96b8035

body_htmlstring
body_textstring
author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

get/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}
 
application/json

Update a review for a pull request

Update the review summary comment with new text.

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

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired
review_idintegerrequired

review_id parameter

Body

application/json
bodystringrequired

The body text of the pull request review.

Response

application/json

Response

Pull Request Review

Pull Request Reviews are reviews on pull requests.

idintegerrequired

Unique identifier of the review

Example:42

node_idstringrequired

Example:MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=

userobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The text of the review.

Example:This looks great.

statestringrequired

Example:CHANGES_REQUESTED

html_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80

pull_request_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/pulls/12

_linksobjectrequired
Show Child Parameters
submitted_atstring(date-time)
commit_idstringrequired

A commit SHA for the review.

Example:54bb654c9e6025347f57900a4a5c2313a96b8035

body_htmlstring
body_textstring
author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

put/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}

Body

{ "body": "This is close to perfect! Please address the suggested inline change. And add more about this." }
 
application/json

Delete a pending review for a pull request

delete
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired
review_idintegerrequired

review_id parameter

Response

application/json

Response

Pull Request Review

Pull Request Reviews are reviews on pull requests.

idintegerrequired

Unique identifier of the review

Example:42

node_idstringrequired

Example:MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=

userobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The text of the review.

Example:This looks great.

statestringrequired

Example:CHANGES_REQUESTED

html_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80

pull_request_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/pulls/12

_linksobjectrequired
Show Child Parameters
submitted_atstring(date-time)
commit_idstringrequired

A commit SHA for the review.

Example:54bb654c9e6025347f57900a4a5c2313a96b8035

body_htmlstring
body_textstring
author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

delete/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}
 
application/json