# Create a discussion comment (Legacy)

From **GitHub v3 REST API**.

`POST /teams/{team_id}/discussions/{discussion_number}/comments`

**Deprecated.**

**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 a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-comment) endpoint.

Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).

This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details.

## Parameters

### `team_id`

- Location: path
- Required: true
- Type: `integer`

### `discussion_number`

- Location: path
- Required: true
- Type: `integer`

## Request body

- Required: true
### `application/json`

- Type: `object`

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

```json
{"properties":{"body":{"description":"The discussion comment's body text.","type":"string"}},"required":["body"],"type":"object"}
```

## Responses

### `201`

Response

### `application/json`

- Type: `object`

A reply to a discussion within a team.

```json
{
  "author": {
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "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}",
    "gravatar_id": "",
    "html_url": "https://github.com/octocat",
    "id": 1,
    "login": "octocat",
    "node_id": "MDQ6VXNlcjE=",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "site_admin": false,
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "type": "User",
    "url": "https://api.github.com/users/octocat"
  },
  "body": "Do you like apples?",
  "body_html": "\u003cp\u003eDo you like apples?\u003c/p\u003e",
  "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51",
  "created_at": "2018-01-15T23:53:58Z",
  "discussion_url": "https://api.github.com/teams/2403582/discussions/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1",
  "last_edited_at": null,
  "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=",
  "number": 1,
  "reactions": {
    "+1": 3,
    "-1": 1,
    "confused": 0,
    "eyes": 1,
    "heart": 1,
    "hooray": 0,
    "laugh": 0,
    "rocket": 1,
    "total_count": 5,
    "url": "https://api.github.com/teams/2403582/discussions/1/reactions"
  },
  "updated_at": "2018-01-15T23:53:58Z",
  "url": "https://api.github.com/teams/2403582/discussions/1/comments/1"
}
```

```json
{"description":"A reply to a discussion within a team.","properties":{"author":{"$ref":"#/components/schemas/nullable-simple-user"},"body":{"description":"The main text of the comment.","example":"I agree with this suggestion.","type":"string"},"body_html":{"example":"\u003cp\u003eDo you like apples?\u003c/p\u003e","type":"string"},"body_version":{"description":"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","type":"string"},"created_at":{"example":"2018-01-15T23:53:58Z","format":"date-time","type":"string"},"discussion_url":{"example":"https://api.github.com/organizations/1/team/2403582/discussions/1","format":"uri","type":"string"},"html_url":{"example":"https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1","format":"uri","type":"string"},"last_edited_at":{"format":"date-time","nullable":true,"type":"string"},"node_id":{"example":"MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=","type":"string"},"number":{"description":"The unique sequence number of a team discussion comment.","example":42,"type":"integer"},"reactions":{"$ref":"#/components/schemas/reaction-rollup"},"updated_at":{"example":"2018-01-15T23:53:58Z","format":"date-time","type":"string"},"url":{"example":"https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1","format":"uri","type":"string"}},"required":["author","body","body_html","body_version","created_at","last_edited_at","discussion_url","html_url","node_id","number","updated_at","url"],"title":"Team Discussion Comment","type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url {protocol}://{hostname}/api/v3/teams/{team_id}/discussions/{discussion_number}/comments \
  --header 'content-type: application/json' \
  --data '{
  "body": "Do you like apples?"
}'
```
