GitHub v3 REST API

Remove requested reviewers from a pull request

delete
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers

Path Parameters

ownerstringrequired
repostringrequired
pull_numberintegerrequired

Body

application/json
reviewersarray[string]required

An array of user logins that will be removed.

team_reviewersarray[string]

An array of team slugs that will be removed.

Response

application/json

Response

Pull Request Simple

Pull Request Simple

urlstring(uri)required

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

idintegerrequired

Example:1

node_idstringrequired

Example:MDExOlB1bGxSZXF1ZXN0MQ==

html_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/1347

diff_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/1347.diff

patch_urlstring(uri)required

Example:https://github.com/octocat/Hello-World/pull/1347.patch

issue_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/issues/1347

commits_urlstring(uri)required

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

review_comments_urlstring(uri)required

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

review_comment_urlstringrequired

Example:https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}

comments_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/issues/1347/comments

statuses_urlstring(uri)required

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

numberintegerrequired

Example:1347

statestringrequired

Example:open

lockedbooleanrequired

Example:true

titlestringrequired

Example:new-feature

userobject | nullrequired

Simple User

Show Child Parameters
bodystring | nullrequired

Example:Please pull these awesome changes

labelsarray[object]required
Show Child Parameters
milestoneobject | nullrequired

A collection of related issues and pull requests.

Show Child Parameters
active_lock_reasonstring | null

Example:too heated

created_atstring(date-time)required

Example:2011-01-26T19:01:12Z

updated_atstring(date-time)required

Example:2011-01-26T19:01:12Z

closed_atstring | null(date-time)required

Example:2011-01-26T19:01:12Z

merged_atstring | null(date-time)required

Example:2011-01-26T19:01:12Z

merge_commit_shastring | nullrequired

Example:e5bd3914e2e596debea16f433f57875b5b90bcd6

assigneeobject | nullrequired

Simple User

Show Child Parameters
assigneesarray | null[object]

Simple User

Show Child Parameters
requested_reviewersarray | null[object]

Simple User

Show Child Parameters
requested_teamsarray | null[object]

Groups of organization members that gives permissions on specified repositories.

Show Child Parameters
headobjectrequired
Show Child Parameters
baseobjectrequired
Show Child Parameters
_linksobjectrequired
Show Child Parameters
author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

draftboolean

Indicates whether or not the pull request is a draft.

Example:false

delete/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers

Body

{ "reviewers": [ "octocat", "hubot", "other_user" ], "team_reviewers": [ "justice-league" ] }
 
application/json

List reviews for a pull request

The list of reviews returns in chronological order.

get
{protocol}://{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
{protocol}://{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
{protocol}://{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
{protocol}://{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