# Create a gist comment

From **GitHub v3 REST API**.

`POST /gists/{gist_id}/comments`

Create a gist comment

## Parameters

### `gist_id`

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

gist_id parameter

## Request body

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

- Type: `object`

```json
{"properties":{"body":{"description":"The comment text.","example":"Body of the attachment","maxLength":65535,"type":"string"}},"required":["body"],"type":"object"}
```

## Responses

### `201`

Response

#### Headers

##### `Location`

- Type: `string`

- Example: `https://api.github.com/gists/a6db0bec360bb87e9418/comments/1`

### `application/json`

- Type: `object`

A comment made to a gist.

```json
{
  "author_association": "COLLABORATOR",
  "body": "Just commenting for the sake of commenting",
  "created_at": "2011-04-18T23:23:56Z",
  "id": 1,
  "node_id": "MDExOkdpc3RDb21tZW50MQ==",
  "updated_at": "2011-04-18T23:23:56Z",
  "url": "https://api.github.com/gists/a6db0bec360bb87e9418/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":"A comment made to a gist.","properties":{"author_association":{"$ref":"#/components/schemas/author_association"},"body":{"description":"The comment text.","example":"Body of the attachment","maxLength":65535,"type":"string"},"created_at":{"example":"2011-04-18T23:23:56Z","format":"date-time","type":"string"},"id":{"example":1,"type":"integer"},"node_id":{"example":"MDExOkdpc3RDb21tZW50MQ==","type":"string"},"updated_at":{"example":"2011-04-18T23:23:56Z","format":"date-time","type":"string"},"url":{"example":"https://api.github.com/gists/a6db0bec360bb87e9418/comments/1","format":"uri","type":"string"},"user":{"$ref":"#/components/schemas/nullable-simple-user"}},"required":["url","id","node_id","user","body","author_association","created_at","updated_at"],"title":"Gist Comment","type":"object"}
```

### `304`

Not modified

### `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"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url {protocol}://{hostname}/api/v3/gists/{gist_id}/comments \
  --header 'content-type: application/json' \
  --data '{
  "body": "string"
}'
```
