Skip to content

Get a review comment for a pull request

GET
/repos/{owner}/{repo}/pulls/comments/{comment_id}

Provides details for a specified review comment.

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 include body. 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 include body_text.
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body’s markdown. Response will include body_html.
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

comment_id
required
integer format: int64

The unique identifier of the comment.

Response

Media type application/json
Pull Request Review Comment

Pull Request Review Comments are comments on a portion of the Pull Request’s diff.

object
url
required

URL for the pull request review comment

string
pull_request_review_id
required

The ID of the pull request review to which the comment belongs.

integer format: int64
nullable
id
required

The ID of the pull request review comment.

integer format: int64
node_id
required

The node ID of the pull request review comment.

string
diff_hunk
required

The diff of the line that the comment refers to.

string
path
required

The relative path of the file to which the comment applies.

string
position

The line index in the diff to which the comment applies. This field is closing down; use line instead.

integer
original_position

The index of the original line in the diff to which the comment applies. This field is closing down; use original_line instead.

integer
commit_id
required

The SHA of the commit to which the comment applies.

string
original_commit_id
required

The SHA of the original commit to which the comment applies.

string
in_reply_to_id

The comment ID to reply to.

integer
user
required
Simple User

A GitHub user.

object
name
string
nullable
email
string
nullable
login
required
string
id
required
integer format: int64
node_id
required
string
avatar_url
required
string format: uri
gravatar_id
required
string
nullable
url
required
string format: uri
html_url
required
string format: uri
followers_url
required
string format: uri
following_url
required
string
gists_url
required
string
starred_url
required
string
subscriptions_url
required
string format: uri
organizations_url
required
string format: uri
repos_url
required
string format: uri
events_url
required
string
received_events_url
required
string format: uri
type
required
string
site_admin
required
boolean
starred_at
string
user_view_type
string
body
required

The text of the comment.

string
created_at
required
string format: date-time
updated_at
required
string format: date-time
html_url
required

HTML URL for the pull request review comment.

string format: uri
pull_request_url
required

URL for the pull request that the review comment belongs to.

string format: uri
author_association
required
author_association

How the author is associated with the repository.

string
Allowed values: COLLABORATOR CONTRIBUTOR FIRST_TIMER FIRST_TIME_CONTRIBUTOR MANNEQUIN MEMBER NONE OWNER
_links
required
object
self
required
object
href
required
string format: uri
html
required
object
href
required
string format: uri
pull_request
required
object
href
required
string format: uri
start_line

The first line of the range for a multi-line comment.

integer
nullable
original_start_line

The first line of the range for a multi-line comment.

integer
nullable
start_side

The side of the first line of the range for a multi-line comment.

string
default: RIGHT nullable
Allowed values: LEFT RIGHT
line

The line of the blob to which the comment applies. The last line of the range for a multi-line comment

integer
original_line

The line of the blob to which the comment applies. The last line of the range for a multi-line comment

integer
side

The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment

string
default: RIGHT
Allowed values: LEFT RIGHT
subject_type

The level at which the comment is targeted, can be a diff line or a file.

string
Allowed values: line file
reactions
Reaction Rollup
object
url
required
string format: uri
total_count
required
integer
+1
required
integer
-1
required
integer
laugh
required
integer
confused
required
integer
heart
required
integer
hooray
required
integer
eyes
required
integer
rocket
required
integer
body_html
string
body_text
string
Examples
Example default
{
"url": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1",
"pull_request_review_id": 42,
"id": 10,
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
"path": "file1.txt",
"position": 1,
"original_position": 4,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
"in_reply_to_id": 8,
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Great stuff!",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
"pull_request_url": "https://api.github.com/repos/octocat/Hello-World/pulls/1",
"author_association": "NONE",
"_links": {
"self": {
"href": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1"
},
"html": {
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
},
"pull_request": {
"href": "https://api.github.com/repos/octocat/Hello-World/pulls/1"
}
},
"start_line": 1,
"original_start_line": 1,
"start_side": "RIGHT",
"line": 2,
"original_line": 2,
"side": "RIGHT"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}