POST /repos/{owner}/{repo}/pulls/{pull_number}/comments
Creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "Create an issue comment."
If your comment applies to more than one line in the pull request diff, you should use the parameters line
, side
, and optionally start_line
and start_side
in your request.
The position
parameter is closing down. If you use position
, the line
, side
, start_line
, and start_side
parameters are not required.
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."
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 |
---|---|---|---|
start_side |
String | No |
Required when using multi-line comments unless using Possible values:
|
commit_id |
String | Yes |
The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the |
body |
String | Yes |
The text of the review comment. |
side |
String | No |
In a split diff view, the side of the diff that the pull request's changes appear on. Can be Possible values:
|
in_reply_to |
Integer | No |
The ID of the review comment to reply to. To find the ID of a review comment with "List review comments on a pull request". When specified, all parameters other than |
line |
Integer | No |
Required unless using |
subject_type |
String | No |
The level at which the comment is targeted. Possible values:
|
position |
Integer | No |
This parameter is closing down. Use |
path |
String | Yes |
The relative path to the file that necessitates a comment. |
start_line |
Integer | No |
Required when using multi-line comments unless using |
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.