This version of GitHub Enterprise was discontinued on 2021-06-09. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Reactions

The Reactions API enables you to create, list and delete the reactions on comments.

Reaction types

When creating a reaction, the allowed values for the content parameter are as follows (with the corresponding emoji for reference):

contentemoji
+1👍
-1👎
laugh😄
confused😕
heart❤️
hooray🎉
rocket🚀
eyes👀

List reactions for a team discussion comment

List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

org string path
team_slug string path

team_slug parameter

discussion_number integer path
comment_number integer path
content string query

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
  org: 'org',
  team_slug: 'team_slug',
  discussion_number: 42,
  comment_number: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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"
  }
]

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.

☝️This header is required.

Create reaction for a team discussion comment

Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion comment.

Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

org string path
team_slug string path

team_slug parameter

discussion_number integer path
comment_number integer path
content string body

Required. The reaction type to add to the team discussion comment.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
  org: 'org',
  team_slug: 'team_slug',
  discussion_number: 42,
  comment_number: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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"
}

Response

Status: 201 Created
{
  "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"
}

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.

☝️This header is required.

Delete team discussion comment reaction

Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id.

Delete a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope.

delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

org string path
team_slug string path

team_slug parameter

discussion_number integer path
comment_number integer path
reaction_id integer path

Code samples

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}', {
  org: 'org',
  team_slug: 'team_slug',
  discussion_number: 42,
  comment_number: 42,
  reaction_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

List reactions for a team discussion

List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

org string path
team_slug string path

team_slug parameter

discussion_number integer path
content string query

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
  org: 'org',
  team_slug: 'team_slug',
  discussion_number: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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"
  }
]

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.

☝️This header is required.

Create reaction for a team discussion

Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion.

Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

org string path
team_slug string path

team_slug parameter

discussion_number integer path
content string body

Required. The reaction type to add to the team discussion.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
  org: 'org',
  team_slug: 'team_slug',
  discussion_number: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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"
}

Response

Status: 201 Created
{
  "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"
}

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.

☝️This header is required.

Delete team discussion reaction

Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id.

Delete a reaction to a team discussion. OAuth access tokens require the write:discussion scope.

delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

org string path
team_slug string path

team_slug parameter

discussion_number integer path
reaction_id integer path

Code samples

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}', {
  org: 'org',
  team_slug: 'team_slug',
  discussion_number: 42,
  reaction_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

Delete a reaction (Legacy)

Deprecation Notice: This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this blog post.

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

This API is under preview and subject to change.See preview notice

reaction_id integer path

Code samples

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /reactions/{reaction_id}', {
  reaction_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

Response

Status: 204 No Content

Not modified

Status: 304 Not Modified

Requires authentication

Status: 401 Unauthorized

Forbidden

Status: 403 Forbidden

Gone

Status: 410 Gone

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.

☝️This header is required.

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)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/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'
    ]
  }
})

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.

☝️This header is required.

Create reaction for a commit comment

Create a reaction to a commit comment. A response with an HTTP 200 status means that you already added the reaction type to this commit comment.

post /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 body

Required. The reaction type to add to the commit comment.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/comments/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

Reaction exists

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"
}

Reaction created

Status: 201 Created
{
  "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"
}

Preview header missing

Status: 415 Unsupported Media Type

Validation failed

Status: 422 Unprocessable Entity

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.

☝️This header is required.

Delete a commit comment reaction

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to a commit comment.

delete /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}

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

reaction_id integer path

Code samples

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/comments/42/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  reaction_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

get /repos/{owner}/{repo}/issues/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 an issue comment.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/issues/comments/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

Create reaction for an issue comment

Create a reaction to an issue comment. A response with an HTTP 200 status means that you already added the reaction type to this issue comment.

post /repos/{owner}/{repo}/issues/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 body

Required. The reaction type to add to the issue comment.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/issues/comments/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

Reaction exists

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"
}

Reaction created

Status: 201 Created
{
  "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"
}

Preview header missing

Status: 415 Unsupported Media Type

Validation failed

Status: 422 Unprocessable Entity

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.

☝️This header is required.

Delete an issue comment reaction

Note: You can also specify a repository by repository_id using the route DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to an issue comment.

delete /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}

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

reaction_id integer path

Code samples

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/issues/comments/42/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  reaction_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

List reactions for an issue

List the reactions to an issue.

get /repos/{owner}/{repo}/issues/{issue_number}/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
issue_number integer path

issue_number parameter

content string query

Returns a single reaction type. Omit this parameter to list all reactions to an issue.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/issues/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
  owner: 'octocat',
  repo: 'hello-world',
  issue_number: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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

Gone

Status: 410 Gone

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.

☝️This header is required.

Create reaction for an issue

Create a reaction to an issue. A response with an HTTP 200 status means that you already added the reaction type to this issue.

post /repos/{owner}/{repo}/issues/{issue_number}/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
issue_number integer path

issue_number parameter

content string body

Required. The reaction type to add to the issue.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/issues/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
  owner: 'octocat',
  repo: 'hello-world',
  issue_number: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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"
}

Response

Status: 201 Created
{
  "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"
}

Preview header missing

Status: 415 Unsupported Media Type

Validation failed

Status: 422 Unprocessable Entity

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.

☝️This header is required.

Delete an issue reaction

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

Delete a reaction to an issue.

delete /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}

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
issue_number integer path

issue_number parameter

reaction_id integer path

Code samples

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/issues/42/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  issue_number: 42,
  reaction_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

get /repos/{owner}/{repo}/pulls/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 pull request review comment.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/pulls/comments/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

Create reaction for a pull request review comment

Create a reaction to a pull request review comment. A response with an HTTP 200 status means that you already added the reaction type to this pull request review comment.

post /repos/{owner}/{repo}/pulls/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 body

Required. The reaction type to add to the pull request review comment.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/pulls/comments/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

Reaction exists

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"
}

Reaction created

Status: 201 Created
{
  "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"
}

Preview header missing

Status: 415 Unsupported Media Type

Validation failed

Status: 422 Unprocessable Entity

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.

☝️This header is required.

Delete a pull request comment reaction

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to a pull request review comment.

delete /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}

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

reaction_id integer path

Code samples

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/pulls/comments/42/reactions/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  comment_id: 42,
  reaction_id: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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.

☝️This header is required.

List reactions for a team discussion comment (Legacy)

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion comment endpoint.

List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

get /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

team_id integer path
discussion_number integer path
comment_number integer path
content string query

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/teams/42/discussions/42/comments/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
  team_id: 42,
  discussion_number: 42,
  comment_number: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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"
  }
]

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.

☝️This header is required.

Create reaction for a team discussion comment (Legacy)

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "Create reaction for a team discussion comment" endpoint.

Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion comment.

post /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

team_id integer path
discussion_number integer path
comment_number integer path
content string body

Required. The reaction type to add to the team discussion comment.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/teams/42/discussions/42/comments/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
  team_id: 42,
  discussion_number: 42,
  comment_number: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

Response

Status: 201 Created
{
  "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"
}

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.

☝️This header is required.

List reactions for a team discussion (Legacy)

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion endpoint.

List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

get /teams/{team_id}/discussions/{discussion_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

team_id integer path
discussion_number integer path
content string query

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Code samples

Shell
curl \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/teams/42/discussions/42/reactions
JavaScript (@octokit/core.js)
await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/reactions', {
  team_id: 42,
  discussion_number: 42,
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

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"
  }
]

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.

☝️This header is required.

Create reaction for a team discussion (Legacy)

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion endpoint.

Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion.

post /teams/{team_id}/discussions/{discussion_number}/reactions

Parameters

Name Type In Description
accept string header

This API is under preview and subject to change.See preview notice

team_id integer path
discussion_number integer path
content string body

Required. The reaction type to add to the team discussion.

Code samples

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
  http(s)://{hostname}/api/v3/teams/42/discussions/42/reactions \
  -d '{"content":"content"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/reactions', {
  team_id: 42,
  discussion_number: 42,
  content: 'content',
  mediaType: {
    previews: [
      'squirrel-girl'
    ]
  }
})

Response

Status: 201 Created
{
  "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"
}

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.

☝️This header is required.