# Create comment

`POST https://api.airtable.com/v0/{baseId}/{tableIdOrName}/{recordId}/comments`

Creates a comment on a record. [User mentioned](https://airtable.com/developers/web/api/model/user-mentioned.md) is supported.

## Requirements

- **Authentication:** [Personal access token](https://airtable.com/developers/web/api/authentication.md#types-of-token), [OAuth integration](https://airtable.com/developers/web/api/authentication.md#types-of-token)
- **Scope:** [`data.recordComments:write`](https://airtable.com/developers/web/api/scopes.md#data-record-comments-write)
- **User role:** Base commenter
- **Billing plans:** All plans

## Path parameters

- `baseId: string`

- `tableIdOrName: string`

- `recordId: string`

## Request body

- `parentCommentId: string` — optional

  A comment ID

- `text: string` — required

## Response format

- `id: string` — required

  A comment ID

- `createdTime: string` — required

  A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"

- `lastUpdatedTime: string | null` — required

  A date timestamp in the ISO format, eg: `"2018-01-01T00:00:00.000Z"`, or null if
  this comment has not been updated since creation.

- `text: string` — required

  The comment text itself. Note that this can contain the user mentioned in the text.
  See [user mentioned](https://airtable.com/developers/web/api/model/user-mentioned.md) for more.

- `parentCommentId: string` — optional

  The comment ID of the parent comment, if this comment is a threaded reply.

- `mentioned: object` — optional

  - `[key: string]: User-mentioned`

- `attachments: array<object>` — optional

  A list of attachments on this comment. Each attachment includes a URL that expires
  2 hours after being returned from the API.

  - `id: string` — required

    Unique attachment id

  - `type: string` — optional

    Content type, e.g. "image/jpeg"

  - `filename: string` — required

    Filename, e.g. "foo.jpg"

  - `url: string` — required

    url, e.g. "https://v5.airtableusercontent.com/foo".

    URLs returned will expire 2 hours after being returned from our API.
    If you want to persist the attachments, we recommend downloading them instead of saving the URL.
    See [our support article](https://support.airtable.com/docs/airtable-attachment-url-behavior)
    for more information.

  - `height: number` — optional

    Height, in pixels (these may be available if the attachment is an image)

  - `size: number` — optional

    File size, in bytes

  - `width: number` — optional

    Width, in pixels (these may be available if the attachment is an image)

  - `thumbnails: object` — optional

    These small, large, and full thumbnails may be available if attachment is an image or document

    - `full: object` — optional

      - `url: string` — required

        These may be available if the attachment is an image or document. See notes under `url` about the lifetime of these URLs.

      - `height: number` — optional

      - `width: number` — optional

    - `large: object` — optional

      - `url: string` — required

        These may be available if the attachment is an image or document. See notes under `url` about the lifetime of these URLs.

      - `height: number` — optional

      - `width: number` — optional

    - `small: object` — optional

      - `url: string` — required

        These may be available if the attachment is an image or document. See notes under `url` about the lifetime of these URLs.

      - `height: number` — optional

      - `width: number` — optional

- `reactions: array<object>` — optional

  A list of reactions on this comment. Each entry contains information about the emoji itself,
  along with metadata about the user who reacted.

  - `emoji: object` — required

    - `unicodeCharacter: string` — required

  - `reactingUser: object` — required

    - `userId: string` — required

      A user ID

    - `email: string` — required

    - `name: string` — optional

- `author: object` — required

  - `id: string` — required

    A user ID

  - `email: string` — required

  - `name: string` — optional

### Example — Success response

```sh
curl -X POST "https://api.airtable.com/v0/{baseId}/{tableIdOrName}/{recordId}/comments" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "text": "Hello, world!"
  }'
```

```json
{
  "author": {
    "email": "foo@bar.com",
    "id": "usrL2PNC5o3H4lBEi",
    "name": "Foo Bar"
  },
  "createdTime": "2021-03-01T09:00:00.000Z",
  "id": "comB5z37Mg9zaEPw6",
  "lastUpdatedTime": null,
  "text": "Hello, world!"
}
```

### Example — Success response mention

```sh
curl -X POST "https://api.airtable.com/v0/{baseId}/{tableIdOrName}/{recordId}/comments" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "parentCommentId": "comB5z37Mg9zaEPw6",
    "text": "Hello from a threaded reply, @[usrL2PNC5o3H4lBEi]"
  }'
```

```json
{
  "author": {
    "email": "foo@bam.com",
    "id": "usrsOEchC9xuwRgKk",
    "name": "Foo Baz"
  },
  "createdTime": "2021-03-01T10:00:00.000Z",
  "id": "comeNPu0X9K4Rxzid",
  "lastUpdatedTime": null,
  "mentioned": {
    "usrL2PNC5o3H4lBEi": {
      "displayName": "Foo Bar",
      "email": "foo@bar.com",
      "id": "usrL2PNC5o3H4lBEi",
      "type": "user"
    }
  },
  "parentCommentId": "comB5z37Mg9zaEPw6",
  "text": "Hello from a threaded reply, @[usrL2PNC5o3H4lBEi]"
}
```
