# Create a note comment

`POST /api/note/{noteId}/comment`

URL: https://repsona.com/api/post-note-noteid-comment

Accepts an editor doc (TipTap JSON) or a markdown string; stored as markdown.

## Parameters

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `noteId` | path | integer | required | ID of the note. |

## Request body

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `doc` | body | object |  | Comment as an editor document (ProseMirror JSON, with a `type: "doc"` root). Send either `doc` or `markdown`; `markdown` wins if both are given. |
| `markdown` | body | string |  | Comment as Markdown (up to 20,000 characters). Send either `doc` or `markdown`. |
| `parentId` | body | integer \| null |  | ID of the comment to reply to. Omit or `null` to post a top-level comment. |

## Request

```sh
curl -X POST "https://<space>.repsona.com/api/note/{noteId}/comment" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "Action items are listed below.",
    "parentId": null
  }'
```

## Responses

- 200: Created comment
- 400: Empty body or invalid parent
- 401: Authentication is required
- 403: Not a project member
- 404: Note not found

## Example response

```json
{
  "comment": {
    "id": 37,
    "parentId": null,
    "comment": "Action items are listed below.",
    "createdAt": 1793662651378,
    "updatedAt": 1793662651378,
    "user": {
      "id": 1126,
      "name": "reon",
      "fullName": "Reon Walls",
      "avatarUrl": null,
      "color": null,
      "state": "active"
    },
    "files": [],
    "deleted": false,
    "reactions": [],
    "children": []
  }
}
```
