GitHub v3 REST API

List discussion comments

List all comments on 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}/comments.

get
{protocol}://{hostname}/api/v3/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments

Query Parameters

directionstring

One of asc (ascending) or desc (descending).

Allowed values:ascdesc

Default:desc

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

orgstringrequired
team_slugstringrequired

team_slug parameter

discussion_numberintegerrequired

Response

200 application/json

Response

A reply to a discussion within a team.

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the comment.

Example:I agree with this suggestion.

body_htmlstringrequired

Example:<p>Do you like apples?</p>

body_versionstringrequired

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example:0307116bbf7ced493b8d8a346c650b71

created_atstring(date-time)required

Example:2018-01-15T23:53:58Z

last_edited_atstring | null(date-time)required
discussion_urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1

html_urlstring(uri)required

Example:https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1

node_idstringrequired

Example:MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=

numberintegerrequired

The unique sequence number of a team discussion comment.

Example:42

updated_atstring(date-time)required

Example:2018-01-15T23:53:58Z

urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1

reactionsobject
Show Child Parameters
get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments
 
200 application/json

Create a discussion comment

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 secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.

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.

post
{protocol}://{hostname}/api/v3/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments

Path Parameters

orgstringrequired
team_slugstringrequired

team_slug parameter

discussion_numberintegerrequired

Body

application/json
bodystringrequired

The discussion comment’s body text.

Response

201 application/json

Response

Team Discussion Comment

A reply to a discussion within a team.

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the comment.

Example:I agree with this suggestion.

body_htmlstringrequired

Example:<p>Do you like apples?</p>

body_versionstringrequired

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example:0307116bbf7ced493b8d8a346c650b71

created_atstring(date-time)required

Example:2018-01-15T23:53:58Z

last_edited_atstring | null(date-time)required
discussion_urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1

html_urlstring(uri)required

Example:https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1

node_idstringrequired

Example:MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=

numberintegerrequired

The unique sequence number of a team discussion comment.

Example:42

updated_atstring(date-time)required

Example:2018-01-15T23:53:58Z

urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1

reactionsobject
Show Child Parameters
post/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments

Body

{ "body": "Do you like apples?" }
 
201 application/json

Get a discussion comment

Get a specific comment on 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}/comments/{comment_number}.

get
{protocol}://{hostname}/api/v3/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}

Path Parameters

orgstringrequired
team_slugstringrequired

team_slug parameter

discussion_numberintegerrequired
comment_numberintegerrequired

Response

200 application/json

Response

Team Discussion Comment

A reply to a discussion within a team.

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the comment.

Example:I agree with this suggestion.

body_htmlstringrequired

Example:<p>Do you like apples?</p>

body_versionstringrequired

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example:0307116bbf7ced493b8d8a346c650b71

created_atstring(date-time)required

Example:2018-01-15T23:53:58Z

last_edited_atstring | null(date-time)required
discussion_urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1

html_urlstring(uri)required

Example:https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1

node_idstringrequired

Example:MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=

numberintegerrequired

The unique sequence number of a team discussion comment.

Example:42

updated_atstring(date-time)required

Example:2018-01-15T23:53:58Z

urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1

reactionsobject
Show Child Parameters
get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
 
200 application/json

Update a discussion comment

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

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

patch
{protocol}://{hostname}/api/v3/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}

Path Parameters

orgstringrequired
team_slugstringrequired

team_slug parameter

discussion_numberintegerrequired
comment_numberintegerrequired

Body

application/json
bodystringrequired

The discussion comment’s body text.

Response

200 application/json

Response

Team Discussion Comment

A reply to a discussion within a team.

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the comment.

Example:I agree with this suggestion.

body_htmlstringrequired

Example:<p>Do you like apples?</p>

body_versionstringrequired

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example:0307116bbf7ced493b8d8a346c650b71

created_atstring(date-time)required

Example:2018-01-15T23:53:58Z

last_edited_atstring | null(date-time)required
discussion_urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1

html_urlstring(uri)required

Example:https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1

node_idstringrequired

Example:MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=

numberintegerrequired

The unique sequence number of a team discussion comment.

Example:42

updated_atstring(date-time)required

Example:2018-01-15T23:53:58Z

urlstring(uri)required

Example:https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1

reactionsobject
Show Child Parameters
patch/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}

Body

{ "body": "Do you like pineapples?" }
 
200 application/json

Delete a discussion comment

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

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

delete
{protocol}://{hostname}/api/v3/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}

Path Parameters

orgstringrequired
team_slugstringrequired

team_slug parameter

discussion_numberintegerrequired
comment_numberintegerrequired

Response

204

Response

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