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.
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."
This endpoint works with the following fine-grained token types:
The fine-grained token must have at least one of the following permission sets:
This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.
accept string Setting to 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. |
Response
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."
This endpoint works with the following fine-grained token types:
The fine-grained token must have at least one of the following permission sets:
This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.
accept string Setting to 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 |
Response
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."
This endpoint works with the following fine-grained token types:
The fine-grained token must have at least one of the following permission sets:
accept string Setting to 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 The contents of the comment. |
| 200 | OK |
| 422 | Validation failed, or the endpoint has been spammed. |
Response
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.
This endpoint works with the following fine-grained token types:
The fine-grained token must have at least one of the following permission sets:
accept string Setting to 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 |
Response
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."
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
accept string Setting to 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. |
Response
You can use the REST API to unpin comments on issues.
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
accept string Setting to 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 |
Response
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."
This endpoint works with the following fine-grained token types:
The fine-grained token must have at least one of the following permission sets:
This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.
accept string Setting to 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 |
Response
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."
This endpoint works with the following fine-grained token types:
The fine-grained token must have at least one of the following permission sets:
accept string Setting to 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 The contents of the comment. |
| 201 | Created |
| 403 | Forbidden |
| 404 | Resource not found |
| 410 | Gone |
| 422 | Validation failed, or the endpoint has been spammed. |
Response
All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.
Make a contribution