Reaction types
When creating a reaction, the allowed values for the content parameter are as follows (with the corresponding emoji for reference):
| content | emoji |
|---|---|
+1 | 👍 |
-1 | 👎 |
laugh | 😄 |
confused | 😕 |
heart | ❤️ |
hooray | 🎉 |
rocket | 🚀 |
eyes | 👀 |
Delete a reaction
OAuth access tokens require the write:discussion scope, when deleting a team discussion or team discussion comment.
delete /reactions/{reaction_id}
Parameters
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to |
accept |
string | header | This API is under preview and subject to change. |
reaction_id |
integer | path |
Code samples
Shell
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /reactions/{reaction_id}', {
reaction_id: 42
})
Default Response
Status: 204 No Content
Notes
Preview notice
An additional reactions object in the issue 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.
List reactions for a commit comment
List the reactions to a commit comment.
get /repos/{owner}/{repo}/comments/{comment_id}/reactions
Parameters
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
This API is under preview and subject to change. See preview notice |
owner |
string | path | |
repo |
string | path | |
comment_id |
integer | path | comment_id parameter |
content |
string | query | Returns a single reaction type. Omit this parameter to list all reactions to a commit comment. |
per_page |
integer | query | Results per page (max 100) |
page |
integer | query | Page number of the results to fetch. |
Code samples
Shell
curl \
-H "Accept: application/vnd.github.squirrel-girl-preview+json" \
https://api.github.com/repos/octocat/hello-world/comments/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
owner: 'octocat',
repo: 'hello-world',
comment_id: 42,
mediaType: {
previews: [
'squirrel-girl'
]
}
})
Default response
Status: 200 OK
[
{
"id": 1,
"node_id": "MDg6UmVhY3Rpb24x",
"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
},
"content": "heart",
"created_at": "2016-05-20T20:09:31Z"
}
]
Resource not found
Status: 404 Not Found
Preview header missing
Status: 415 Unsupported Media Type
Notes
Preview notice
An additional reactions object in the issue 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.