Team Discussion Comments

The team discussion comments API allows you to get, create, edit, and delete discussion comments on a team discussion post. Any member of the team's organization can create and read comments on a public discussion. For more details, see "About team discussions." This API is only available to authenticated members of the team's organization.

List comments

Note: The team discussions API is currently available for developers to preview. See the blog post for full details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.echo-preview+json

Note: The reactions API is available for developers to preview. The url can be used to construct the API location for listing and creating reactions. See the blog post for full details. To receive the reactions object in the response for this endpoint you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

List all comments on a team discussion. OAuth access tokens require the read:discussion scope.

GET /teams/:team_id/discussions/:discussion_number/comments

Parameters

Name Type Description
direction string Sorts the discussion comments by the date they were created. To return the oldest comments first, set to asc. Can be one of asc or desc.
Default: desc

Response

Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
      <https://api.github.com/resource?page=5>; rel="last"
[
  {
    "author": {
      "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
    },
    "body": "Do you like apples?",
    "body_html": "<p>Do you like apples?</p>",
    "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51",
    "created_at": "2018-01-15T23:53:58Z",
    "last_edited_at": null,
    "discussion_url": "https://api.github.com/teams/2403582/discussions/1",
    "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1",
    "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=",
    "number": 1,
    "updated_at": "2018-01-15T23:53:58Z",
    "url": "https://api.github.com/teams/2403582/discussions/1/comments/1",
    "reactions": {
      "url": "https://api.github.com/teams/2403582/discussions/1/reactions",
      "total_count": 5,
      "+1": 3,
      "-1": 1,
      "laugh": 0,
      "confused": 0,
      "heart": 1,
      "hooray": 0
    }
  }
]

Get a single comment

Note: The team discussions API is currently available for developers to preview. See the blog post for full details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.echo-preview+json

Note: The reactions API is available for developers to preview. The url can be used to construct the API location for listing and creating reactions. See the blog post for full details. To receive the reactions object in the response for this endpoint you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

Get a specific comment on a team discussion. OAuth access tokens require the read:discussion scope.

GET /teams/:team_id/discussions/:discussion_number/comments/:comment_number

Response

Status: 200 OK
{
  "author": {
    "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
  },
  "body": "Do you like apples?",
  "body_html": "<p>Do you like apples?</p>",
  "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51",
  "created_at": "2018-01-15T23:53:58Z",
  "last_edited_at": null,
  "discussion_url": "https://api.github.com/teams/2403582/discussions/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1",
  "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=",
  "number": 1,
  "updated_at": "2018-01-15T23:53:58Z",
  "url": "https://api.github.com/teams/2403582/discussions/1/comments/1",
  "reactions": {
    "url": "https://api.github.com/teams/2403582/discussions/1/reactions",
    "total_count": 5,
    "+1": 3,
    "-1": 1,
    "laugh": 0,
    "confused": 0,
    "heart": 1,
    "hooray": 0
  }
}

Create a comment

Note: The team discussions API is currently available for developers to preview. See the blog post for full details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.echo-preview+json

Note: The reactions API is available for developers to preview. The url can be used to construct the API location for listing and creating reactions. See the blog post for full details. To receive the reactions object in the response for this endpoint you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

Creates a new comment on a team discussion. OAuth access tokens require the write:discussion scope.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.

POST /teams/:team_id/discussions/:discussion_number/comments

Parameters

Name Type Description
body string Required. The discussion comment's body text.

Example

{
  "body": "Do you like apples?"
}

Response

Status: 201 Created
{
  "author": {
    "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
  },
  "body": "Do you like apples?",
  "body_html": "<p>Do you like apples?</p>",
  "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51",
  "created_at": "2018-01-15T23:53:58Z",
  "last_edited_at": null,
  "discussion_url": "https://api.github.com/teams/2403582/discussions/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1",
  "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=",
  "number": 1,
  "updated_at": "2018-01-15T23:53:58Z",
  "url": "https://api.github.com/teams/2403582/discussions/1/comments/1",
  "reactions": {
    "url": "https://api.github.com/teams/2403582/discussions/1/reactions",
    "total_count": 5,
    "+1": 3,
    "-1": 1,
    "laugh": 0,
    "confused": 0,
    "heart": 1,
    "hooray": 0
  }
}

Edit a comment

Note: The team discussions API is currently available for developers to preview. See the blog post for full details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.echo-preview+json

Note: The reactions API is available for developers to preview. The url can be used to construct the API location for listing and creating reactions. See the blog post for full details. To receive the reactions object in the response for this endpoint you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

Edits the body text of a discussion comment. OAuth access tokens require the write:discussion scope.

PATCH /teams/:team_id/discussions/:discussion_number/comments/:comment_number

Parameters

Name Type Description
body string Required. The discussion comment's body text.

Example

{
  "body": "Do you like pineapples?"
}

Response

Status: 200 OK
{
  "author": {
    "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
  },
  "body": "Do you like pineapples?",
  "body_html": "<p>Do you like pineapples?</p>",
  "body_version": "e6907b24d9c93cc0c5024a7af5888116",
  "created_at": "2018-01-15T23:53:58Z",
  "last_edited_at": "2018-01-26T18:22:20Z",
  "discussion_url": "https://api.github.com/teams/2403582/discussions/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1",
  "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=",
  "number": 1,
  "updated_at": "2018-01-26T18:22:20Z",
  "url": "https://api.github.com/teams/2403582/discussions/1/comments/1",
  "reactions": {
    "url": "https://api.github.com/teams/2403582/discussions/1/reactions",
    "total_count": 5,
    "+1": 3,
    "-1": 1,
    "laugh": 0,
    "confused": 0,
    "heart": 1,
    "hooray": 0
  }
}

Delete a comment

Note: The team discussions API is currently available for developers to preview. See the blog post for full details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.echo-preview+json

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

Deletes a comment on a team discussion. OAuth access tokens require the write:discussion scope.

DELETE /teams/:team_id/discussions/:discussion_number/comments/:comment_number

Response

Status: 204 No Content