# List task comments as a tree

`GET /api/task/{taskId}/comment`

URL: https://repsona.com/api/get-task-taskid-comment

## Parameters

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `taskId` | path | integer | required | ID of the task. |

## Request

```sh
curl -X GET "https://<space>.repsona.com/api/task/{taskId}/comment" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## Responses

- 200: Comments (children nested)
- 401: Authentication is required
- 403: Not a project member
- 404: Task not found

## Example response

```json
{
  "comments": [
    {
      "id": 75,
      "parentId": null,
      "comment": "I rewrote the hero section. Could you take a look before Friday?",
      "createdAt": 1793662651194,
      "updatedAt": 1793662651194,
      "user": {
        "id": 1127,
        "name": "emma",
        "fullName": "Emma Carter",
        "avatarUrl": null,
        "color": null,
        "state": "active"
      },
      "files": [],
      "deleted": false,
      "reactions": [],
      "children": [
        {
          "id": 76,
          "parentId": 75,
          "comment": "Looks good to me. I only changed the tagline.",
          "createdAt": 1793662651207,
          "updatedAt": 1793662651207,
          "user": {
            "id": 1127,
            "name": "emma",
            "fullName": "Emma Carter",
            "avatarUrl": null,
            "color": null,
            "state": "active"
          },
          "files": [],
          "deleted": false,
          "reactions": [],
          "children": []
        }
      ]
    }
  ]
}
```
