Use the REST API to manage comments on issues and pull requests.
You can use the REST API to create and manage comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. For this reason, "shared" actions for both features, like managing assignees, labels, and milestones, are provided within the Issues endpoints. To manage pull request review comments, see REST API endpoints for pull request review comments.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /repos/{owner}/{repo}/issues/comments
You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.
By default, issue comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
sort (string)
The property to sort the results by.
Default: created
Can be one of: created, updated
direction (string)
Either asc or desc. Ignored without the sort parameter.
Can be one of: asc, desc
since (string)
Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/issues/comments
Response schema (Status: 200):
Array of Issue Comment:
id: required, integer, format: int64node_id: required, stringurl: required, string, format: uribody: stringbody_text: stringbody_html: stringhtml_url: required, string, format: uriuser: required, any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeissue_url: required, string, format: uriauthor_association: string, enum: COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNERperformed_via_github_app: any of:
id: required, integerslug: stringnode_id: required, stringclient_id: stringowner: required, one of:
description: string or nullhtml_url: required, string, format: uriwebsite_url: string or null, format: uriid: required, integernode_id: required, stringname: required, stringslug: required, stringcreated_at: required, string or null, format: date-timeupdated_at: required, string or null, format: date-timeavatar_url: required, string, format: uriname: required, stringdescription: required, string or nullexternal_url: required, string, format: urihtml_url: required, string, format: uricreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timepermissions: required, object, additional properties: string:
issues: stringchecks: stringmetadata: stringcontents: stringdeployments: stringevents: required, array of stringinstallations_count: integerreactions: Reaction Rollup:
url: required, string, format: uritotal_count: required, integer+1: required, integer-1: required, integerlaugh: required, integerconfused: required, integerheart: required, integerhooray: required, integereyes: required, integerrocket: required, integerpin: any of:
pinned_at: required, string, format: date-timepinned_by: required, any of:
minimized: any of:
reason: required, string or nullGET /repos/{owner}/{repo}/issues/comments/{comment_id}
You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
comment_id (integer) (required)
The unique identifier of the comment.
200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/issues/comments/COMMENT_ID
Response schema (Status: 200):
id: required, integer, format: int64node_id: required, stringurl: required, string, format: uribody: stringbody_text: stringbody_html: stringhtml_url: required, string, format: uriuser: required, any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeissue_url: required, string, format: uriauthor_association: string, enum: COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNERperformed_via_github_app: any of:
id: required, integerslug: stringnode_id: required, stringclient_id: stringowner: required, one of:
description: string or nullhtml_url: required, string, format: uriwebsite_url: string or null, format: uriid: required, integernode_id: required, stringname: required, stringslug: required, stringcreated_at: required, string or null, format: date-timeupdated_at: required, string or null, format: date-timeavatar_url: required, string, format: uriname: required, stringdescription: required, string or nullexternal_url: required, string, format: urihtml_url: required, string, format: uricreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timepermissions: required, object, additional properties: string:
issues: stringchecks: stringmetadata: stringcontents: stringdeployments: stringevents: required, array of stringinstallations_count: integerreactions: Reaction Rollup:
url: required, string, format: uritotal_count: required, integer+1: required, integer-1: required, integerlaugh: required, integerconfused: required, integerheart: required, integerhooray: required, integereyes: required, integerrocket: required, integerpin: any of:
pinned_at: required, string, format: date-timepinned_by: required, any of:
minimized: any of:
reason: required, string or nullPATCH /repos/{owner}/{repo}/issues/comments/{comment_id}
You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
comment_id (integer) (required)
The unique identifier of the comment.
body (string) (required)200 - OK
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PATCH \
https://api.github.com/repos/OWNER/REPO/issues/comments/COMMENT_ID \
-d '{
"body": "Me too"
}'
Response schema (Status: 200):
Same response schema as Get an issue comment.
DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}
You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
comment_id (integer) (required)
The unique identifier of the comment.
Request:
curl -L \
-X DELETE \
https://api.github.com/repos/OWNER/REPO/issues/comments/COMMENT_ID
Response schema (Status: 204):
PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin
You can use the REST API to pin comments on issues.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
comment_id (integer) (required)
The unique identifier of the comment.
200 - OK
401 - Requires authentication
403 - Forbidden
404 - Resource not found
410 - Gone
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/issues/comments/COMMENT_ID/pin
Response schema (Status: 200):
Same response schema as Get an issue comment.
DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin
You can use the REST API to unpin comments on issues.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
comment_id (integer) (required)
The unique identifier of the comment.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
410 - Gone
503 - Service unavailable
Request:
curl -L \
-X DELETE \
https://api.github.com/repos/OWNER/REPO/issues/comments/COMMENT_ID/pin
Response schema (Status: 204):
GET /repos/{owner}/{repo}/issues/{issue_number}/comments
You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
Issue comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
issue_number (integer) (required)
The number that identifies the issue.
since (string)
Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
404 - Resource not found
410 - Gone
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/comments
Response schema (Status: 200):
Same response schema as List issue comments for a repository.
POST /repos/{owner}/{repo}/issues/{issue_number}/comments
You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a 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."
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
issue_number (integer) (required)
The number that identifies the issue.
body (string) (required)201 - Created
403 - Forbidden
404 - Resource not found
410 - Gone
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X POST \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/comments \
-d '{
"body": "Me too"
}'
Response schema (Status: 201):
Same response schema as Get an issue comment.