POST
/repos/{owner}/{repo}/issues/{issue_number}/commentsCreate an issue comment
Creates a comment on an issue or pull request in a repository. Provide the Markdown comment text in body; creating the comment triggers notifications and may be subject to secondary rate limiting. Select a media type to control whether the response includes raw, text, or HTML body representations.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
issue_numberintegerrequired
The integer that identifies the issue or pull request within the repository.
The issue comment to create.
bodystringrequired
The contents of the comment.
201Returns the created issue comment, including its identifier, body, author, timestamps, URLs, and reactions.
idintegerrequired
Unique identifier of the issue comment
node_idstringrequired
urlstringrequired
URL for the issue comment
bodystringoptional
Contents of the issue comment
body_textstringoptional
body_htmlstringoptional
html_urlstringrequired
userobjectrequired
A GitHub user.
created_atstringrequired
updated_atstringrequired
issue_urlstringrequired
author_associationstringoptional
How the author is associated with the repository.
performed_via_github_appobjectoptional
GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
reactionsobjectoptional
pinobjectoptional
Context around who pinned an issue comment and when it was pinned.
minimizedobjectoptional
Details about why an issue comment was minimized.
403Returned when the authenticated user is not permitted to create a comment.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the repository or issue does not exist or is not accessible.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
410Returned when the issue is gone.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
Error handling
A 403 is returned when the authenticated user cannot create comments, and a 404 is returned when the repository or issue cannot be found. A 410 is returned when the issue is gone, while a 422 indicates validation failure or excessive activity. body is required and must contain the comment contents.