Skip to main content

Update a discussion comment

Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/[email protected]/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
org string
required
team_slug string
required

team_slug parameter

discussion_number integer
required
comment_number integer
required
Body Params
required
application/jsonobject
body string
required

The discussion comment's body text.

Responses

application/json Team Discussion Comment object

Response

author Simple User object
requirednullable

Simple User

avatar_url string<uri>
required

Example: https://github.com/images/error/octocat_happy.gif

email string
optionalnullable
events_url string
required

Example: https://api.github.com/users/octocat/events{/privacy}

followers_url string<uri>
required

Example: https://api.github.com/users/octocat/followers

following_url string
required

Example: https://api.github.com/users/octocat/following{/other_user}

gists_url string
required

Example: https://api.github.com/users/octocat/gists{/gist_id}

gravatar_id string
requirednullable

Example: 41d064eb2195891e12d0413f63227ea7

html_url string<uri>
required

Example: https://github.com/octocat

id integer
required

Example: 1

login string
required

Example: octocat

name string
optionalnullable
node_id string
required

Example: MDQ6VXNlcjE=

organizations_url string<uri>
required

Example: https://api.github.com/users/octocat/orgs

received_events_url string<uri>
required

Example: https://api.github.com/users/octocat/received_events

repos_url string<uri>
required

Example: https://api.github.com/users/octocat/repos

site_admin boolean
required
starred_at string
optional

Example: "2020-07-09T00:17:55Z"

starred_url string
required

Example: https://api.github.com/users/octocat/starred{/owner}{/repo}

subscriptions_url string<uri>
required

Example: https://api.github.com/users/octocat/subscriptions

type string
required

Example: User

url string<uri>
required

Example: https://api.github.com/users/octocat

body string
required

The main text of the comment.

Example: I agree with this suggestion.

body_html string
required

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

body_version string
required

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_at string<date-time>
required

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

discussion_url string<uri>
required

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

html_url string<uri>
required

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

last_edited_at string<date-time>
requirednullable
node_id string
required

Example: MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=

number integer
required

The unique sequence number of a team discussion comment.

Example: 42

reactions Reaction Rollup object
optional
+1 integer
required
-1 integer
required
confused integer
required
eyes integer
required
heart integer
required
hooray integer
required
laugh integer
required
rocket integer
required
total_count integer
required
url string<uri>
required
updated_at string<date-time>
required

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

url string<uri>
required

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