Skip to main content

comments

Overview

Namecomments
TypeResource
Idgithub.pulls.comments

Fields

NameDatatypeDescription
idintegerThe ID of the pull request review comment.
_linksobject
author_associationstringHow the author is associated with the repository.
bodystringThe text of the comment.
body_htmlstring
body_textstring
commit_idstringThe SHA of the commit to which the comment applies.
created_atstring
diff_hunkstringThe diff of the line that the comment refers to.
html_urlstringHTML URL for the pull request review comment.
in_reply_to_idintegerThe comment ID to reply to.
lineintegerThe line of the blob to which the comment applies. The last line of the range for a multi-line comment
node_idstringThe node ID of the pull request review comment.
original_commit_idstringThe SHA of the original commit to which the comment applies.
original_lineintegerThe line of the blob to which the comment applies. The last line of the range for a multi-line comment
original_positionintegerThe index of the original line in the diff to which the comment applies. This field is deprecated; use original_line instead.
original_start_lineintegerThe first line of the range for a multi-line comment.
pathstringThe relative path of the file to which the comment applies.
positionintegerThe line index in the diff to which the comment applies. This field is deprecated; use line instead.
pull_request_review_idintegerThe ID of the pull request review to which the comment belongs.
pull_request_urlstringURL for the pull request that the review comment belongs to.
reactionsobject
sidestringThe side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment
start_lineintegerThe first line of the range for a multi-line comment.
start_sidestringThe side of the first line of the range for a multi-line comment.
subject_typestringThe level at which the comment is targeted, can be a diff line or a file.
updated_atstring
urlstringURL for the pull request review comment
userobjectA GitHub user.

Methods

NameAccessible byRequired ParamsDescription
get_review_commentSELECTcomment_id, owner, repoProvides details for a review comment.
list_review_commentsSELECTowner, pull_number, repoLists all review comments for a pull request. By default, review comments are in ascending order by ID.
list_review_comments_for_repoSELECTowner, repoLists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.
create_review_commentINSERTowner, pull_number, repo, data__body, data__commit_id, data__path
Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "Create an issue comment." We recommend creating a review comment using line, side, and optionally start_line and start_side if your comment applies to more than one line in the pull request diff.

The position parameter is deprecated. If you use position, the line, side, start_line, and start_side parameters are not required.

Note: 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 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.
delete_review_commentDELETEcomment_id, owner, repoDeletes a review comment.
create_reply_for_review_commentEXECcomment_id, owner, pull_number, repo, data__bodyCreates a reply to a review comment for a pull request. For the comment_id, provide the ID of the review comment you are replying to. This must be the ID of a top-level review comment, not a reply to that comment. Replies to replies are not supported.

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.
update_review_commentEXECcomment_id, owner, repo, data__bodyEnables you to edit a review comment.