POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews
Creates a review on a specified pull request.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."
Pull request reviews created in the PENDING
state are not submitted and therefore do not include the submitted_at
property in the response. To create a pending review for a pull request, leave the event
parameter blank. For more information about submitting a PENDING
review, see "Submit a review for a pull request."
[!NOTE] To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the
application/vnd.github.v3.diff
media type to theAccept
header of a call to the Get a 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.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github-commitcomment.raw+json
: Returns the raw markdown body. Response will includebody
. This is the default if you do not pass any specific media type.application/vnd.github-commitcomment.text+json
: Returns a text only representation of the markdown body. Response will includebody_text
.application/vnd.github-commitcomment.html+json
: Returns HTML rendered from the body's markdown. Response will includebody_html
.application/vnd.github-commitcomment.full+json
: Returns raw, text, and HTML representations. Response will includebody
,body_text
, andbody_html
.
Servers
- https://api.github.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
repo |
String | Yes |
The name of the repository without the |
owner |
String | Yes |
The account owner of the repository. The name is not case sensitive. |
pull_number |
Integer | Yes |
The number that identifies the pull request. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
commit_id |
String | No |
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 |
body |
String | No |
Required when using |
event |
String | No |
The review action you want to perform. The review actions include: Possible values:
|
comments[] |
Array | No |
Use the following table to specify the location, destination, and contents of the draft review comment. |
comments[].start_side |
String | No | |
comments[].body |
String | Yes |
Text of the review comment. |
comments[].side |
String | No | |
comments[].line |
Integer | No | |
comments[].position |
Integer | No |
The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The |
comments[].path |
String | Yes |
The relative path to the file that necessitates a review comment. |
comments[].start_line |
Integer | No |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.