| title | Comments |
|---|
{:toc}
Commit Comments use these custom media types. You can read more about the use of media types in the API here.
Comments are ordered by ascending ID.
GET /repos/:owner/:repo/comments
<%= headers 200, :pagination => default_pagination_rels %> <%= json(:commit_comment) { |h| [h] } %>
{% if page.version == 'dotcom' %}
{{#tip}}
An additional reactions object in the commit comment payload is currently available for developers to preview.
During the preview period, the APIs may change without advance notice.
Please see the blog post for full details.
To access the API you must provide a custom media type in the Accept header:
application/vnd.github.squirrel-girl-preview
The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.
{{/tip}} <%= json :commit_comment_reaction_summary %> {% endif %}
GET /repos/:owner/:repo/commits/:ref/comments
<%= headers 200, :pagination => default_pagination_rels %> <%= json(:commit_comment) { |h| [h] } %>
{% if page.version == 'dotcom' %}
{{#tip}}
An additional reactions object in the commit comment payload is currently available for developers to preview.
During the preview period, the APIs may change without advance notice.
Please see the blog post for full details.
To access the API you must provide a custom media type in the Accept header:
application/vnd.github.squirrel-girl-preview
The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.
{{/tip}} <%= json :commit_comment_reaction_summary %> {% endif %}
POST /repos/:owner/:repo/commits/:sha/comments
| Name | Type | Description |
|---|---|---|
body |
string |
Required. The contents of the comment. |
path |
string |
Relative path of the file to comment on. |
position |
integer |
Line index in the diff to comment on. |
line |
integer |
Deprecated. Use position parameter instead. Line number in the file to comment on. |
<%= json
:body => 'Great stuff',
:path => 'file1.txt',
:position => 4,
:line => nil
%>
<%= headers 201, :Location => get_resource(:commit_comment)['url'] %> <%= json :commit_comment %>
GET /repos/:owner/:repo/comments/:id
<%= headers 200 %> <%= json :commit_comment %>
{% if page.version == 'dotcom' %}
{{#tip}}
An additional reactions object in the commit comment payload is currently available for developers to preview.
During the preview period, the APIs may change without advance notice.
Please see the blog post for full details.
To access the API you must provide a custom media type in the Accept header:
application/vnd.github.squirrel-girl-preview
The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.
{{/tip}} <%= json :commit_comment_reaction_summary %> {% endif %}
PATCH /repos/:owner/:repo/comments/:id
| Name | Type | Description |
|---|---|---|
body |
string |
Required. The contents of the comment |
<%= json
:body => 'Nice change'
%>
<%= headers 200 %> <%= json(:commit_comment) { |h| h.merge('body' => 'Nice change') } %>
DELETE /repos/:owner/:repo/comments/:id
<%= headers 204 %>
These are the supported media types for commit comments. You can read more about the use of media types in the API here.
application/vnd.github-commitcomment.raw+json
application/vnd.github-commitcomment.text+json
application/vnd.github-commitcomment.html+json
application/vnd.github-commitcomment.full+json