# Create reaction for a commit comment

From **GitHub v3 REST API**.

`POST /repos/{owner}/{repo}/comments/{comment_id}/reactions`

Create a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#comments). A response with an HTTP `200` status means that you already added the reaction type to this commit comment.

## Parameters

### `owner`

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

### `repo`

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

### `comment_id`

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

comment_id parameter

## Request body

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

- Type: `object`

```json
{
  "content": "heart"
}
```

```json
{"properties":{"content":{"description":"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the commit comment.","enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"}},"required":["content"],"type":"object"}
```

## Responses

### `200`

Reaction exists

### `application/json`

- Type: `object`

Reactions to conversations provide a way to help people express their feelings more simply and effectively.

```json
{
  "content": "heart",
  "created_at": "2016-05-20T20:09:31Z",
  "id": 1,
  "node_id": "MDg6UmVhY3Rpb24x",
  "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":"Reactions to conversations provide a way to help people express their feelings more simply and effectively.","properties":{"content":{"description":"The reaction to use","enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"example":"heart","type":"string"},"created_at":{"example":"2016-05-20T20:09:31Z","format":"date-time","type":"string"},"id":{"example":1,"type":"integer"},"node_id":{"example":"MDg6UmVhY3Rpb24x","type":"string"},"user":{"$ref":"#/components/schemas/nullable-simple-user"}},"required":["id","node_id","user","content","created_at"],"title":"Reaction","type":"object"}
```

### `201`

Reaction created

### `application/json`

- Type: `object`

Reactions to conversations provide a way to help people express their feelings more simply and effectively.

```json
{
  "content": "heart",
  "created_at": "2016-05-20T20:09:31Z",
  "id": 1,
  "node_id": "MDg6UmVhY3Rpb24x",
  "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":"Reactions to conversations provide a way to help people express their feelings more simply and effectively.","properties":{"content":{"description":"The reaction to use","enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"example":"heart","type":"string"},"created_at":{"example":"2016-05-20T20:09:31Z","format":"date-time","type":"string"},"id":{"example":1,"type":"integer"},"node_id":{"example":"MDg6UmVhY3Rpb24x","type":"string"},"user":{"$ref":"#/components/schemas/nullable-simple-user"}},"required":["id","node_id","user","content","created_at"],"title":"Reaction","type":"object"}
```

### `415`

Preview header missing

### `application/json`

- Type: `object`

```json
{"properties":{"documentation_url":{"type":"string"},"message":{"type":"string"}},"required":["message","documentation_url"],"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}/comments/{comment_id}/reactions \
  --header 'content-type: application/json' \
  --data '{
  "content": "heart"
}'
```
