# Create an issue comment

From **GitHub v3 REST API**.

`POST /repos/{owner}/{repo}/issues/{issue_number}/comments`

This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/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

### `owner`

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

### `repo`

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

### `issue_number`

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

issue_number parameter

## Request body

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

- Type: `object`

```json
{
  "body": "Me too"
}
```

```json
{"properties":{"body":{"description":"The contents of the comment.","type":"string"}},"required":["body"],"type":"object"}
```

## Responses

### `201`

Response

#### Headers

##### `Location`

- Type: `string`

- Example: `https://api.github.com/repos/octocat/Hello-World/issues/comments/1`

### `application/json`

- Type: `object`

Comments provide a way for people to collaborate on an issue.

```json
{
  "author_association": "COLLABORATOR",
  "body": "Me too",
  "created_at": "2011-04-14T16:00:49Z",
  "html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
  "id": 1,
  "issue_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
  "node_id": "MDEyOklzc3VlQ29tbWVudDE=",
  "updated_at": "2011-04-14T16:00:49Z",
  "url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
  "user": {
    "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"
  }
}
```

```json
{"description":"Comments provide a way for people to collaborate on an issue.","properties":{"author_association":{"$ref":"#/components/schemas/author_association"},"body":{"description":"Contents of the issue comment","example":"What version of Safari were you using when you observed this bug?","type":"string"},"body_html":{"type":"string"},"body_text":{"type":"string"},"created_at":{"example":"2011-04-14T16:00:49Z","format":"date-time","type":"string"},"html_url":{"format":"uri","type":"string"},"id":{"description":"Unique identifier of the issue comment","example":42,"type":"integer"},"issue_url":{"format":"uri","type":"string"},"node_id":{"type":"string"},"performed_via_github_app":{"$ref":"#/components/schemas/nullable-integration"},"reactions":{"$ref":"#/components/schemas/reaction-rollup"},"updated_at":{"example":"2011-04-14T16:00:49Z","format":"date-time","type":"string"},"url":{"description":"URL for the issue comment","example":"https://api.github.com/repositories/42/issues/comments/1","format":"uri","type":"string"},"user":{"$ref":"#/components/schemas/nullable-simple-user"}},"required":["id","node_id","html_url","issue_url","author_association","user","url","created_at","updated_at"],"title":"Issue Comment","type":"object"}
```

### `403`

Forbidden

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `404`

Resource not found

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `410`

Gone

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `422`

Validation failed

### `application/json`

- Type: `object`

Validation Error

```json
{"description":"Validation Error","properties":{"documentation_url":{"type":"string"},"errors":{"items":{"properties":{"code":{"type":"string"},"field":{"type":"string"},"index":{"type":"integer"},"message":{"type":"string"},"resource":{"type":"string"},"value":{"oneOf":[{"nullable":true,"type":"string"},{"nullable":true,"type":"integer"},{"items":{"type":"string"},"nullable":true,"type":"array"}]}},"required":["code"],"type":"object"},"type":"array"},"message":{"type":"string"}},"required":["message","documentation_url"],"title":"Validation Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/issues/{issue_number}/comments \
  --header 'content-type: application/json' \
  --data '{
  "body": "Me too"
}'
```
