Review Comments

Pull Request review comments are comments on a portion of the unified
diff. These are separate from Commit Comments (which are applied
directly to a commit, outside of the Pull Request view), and Issue
Comments (which do not reference a portion of the unified diff).

Reactions summary

An additional reactions object in the review comment payload is currently available for developers to preview.
During the preview period, the APIs may change without advance notice.
Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Reactions summary

An additional reactions object in the review comment payload is currently available for developers to preview.
During the preview period, the APIs may change without advance notice.
Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Reactions summary

An additional reactions object in the review comment payload is currently available for developers to preview.
During the preview period, the APIs may change without advance notice.
Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create a comment

Input

Required. 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 position.

path

string

Required. The relative path to the file that necessitates a comment.

position

integer

Required. 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. For help finding the position value, read the note below.

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.diffmedia 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.