---
title: "Comments"
summary: "Comments on tasks. Endpoints, parameters, examples and errors."
url: "https://taskloader.com/docs/api/reference/comments"
---

> Documentation index: https://taskloader.com/llms.txt

# Comments

Comments on tasks. Endpoints, parameters, examples and errors.

Comments on tasks. Everyone in the project can comment, viewers included. Comments are kept as written: they cannot be edited or deleted.

## List a task’s comments {#list_comments}

Lists the comments on a task, newest first (or oldest first), a page at a time.

```http
GET /api/v1/tasks/{taskId}/comments
```

- **Scopes:** `tasks:read`
- **Who:** Viewer or above in the project
- **[Project-limited credentials](https://taskloader.com/docs/authentication.md#project-limited-credentials):** allowed inside the credential’s projects; anything else is `not_found`
- **Retries:** a read; safe to repeat
- **Rate limit:** the `read` bucket

Lists every comment on a task, newest first unless `order` is oldest, in pages of up to 100. A comment shows who wrote it, when, and through which app (`via`). get_task with include=comments returns the newest 20 with a cursor that continues here (order newest).

#### Parameters

| Name     | In    | Type                     | Required | Description                                                                                                                                                           |
| -------- | ----- | ------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskId` | path  | id (`task_…`)            | Yes      | Task id: task_ followed by 32 lowercase hex digits, for example task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718.                                                                |
| `order`  | query | `"newest"` or `"oldest"` | No       | newest first (the default) or oldest first.                                                                                                                           |
| `limit`  | query | integer, 1–100           | No       | How many to return, 1–100, for example 50. Defaults to 50 (25 over MCP).                                                                                              |
| `cursor` | query | string                   | No       | The nextCursor from the previous page, to read the next one. Leave it out for the first page; start again without it when you change filters. Up to 2,048 characters. |

#### Response

`200` with a list of `Comment` objects; while `hasMore` is true, pass `nextCursor` back as `cursor` (with the same filters) for the next page.

| Field        | Type             | Description                                                     |
| ------------ | ---------------- | --------------------------------------------------------------- |
| `object`     | `"list"`         |                                                                 |
| `hasMore`    | boolean          | True when there is a next page.                                 |
| `nextCursor` | string or null   | Pass it as cursor to read the next page; null on the last page. |
| `data`       | array of Comment |                                                                 |

Headers it sends: `Link`.

#### Errors

| Status | Code                                                        | Meaning                                    |
| ------ | ----------------------------------------------------------- | ------------------------------------------ |
| 400    | [`invalid_id`](https://taskloader.com/docs/api/errors.md#invalid_id)                 | The id is for a different kind of resource |
| 400    | [`invalid_cursor`](https://taskloader.com/docs/api/errors.md#invalid_cursor)         | The cursor is not valid                    |
| 403    | [`insufficient_scope`](https://taskloader.com/docs/api/errors.md#insufficient_scope) | The credential lacks the required access   |
| 404    | [`not_found`](https://taskloader.com/docs/api/errors.md#not_found)                   | Not found                                  |

And the errors every operation can return: [`invalid_request`](https://taskloader.com/docs/api/errors.md#invalid_request), [`validation_failed`](https://taskloader.com/docs/api/errors.md#validation_failed), [`token_in_url`](https://taskloader.com/docs/api/errors.md#token_in_url), [`unauthenticated`](https://taskloader.com/docs/api/errors.md#unauthenticated), [`invalid_token`](https://taskloader.com/docs/api/errors.md#invalid_token), [`rate_limited`](https://taskloader.com/docs/api/errors.md#rate_limited), [`internal_error`](https://taskloader.com/docs/api/errors.md#internal_error), [`service_unavailable`](https://taskloader.com/docs/api/errors.md#service_unavailable).

#### Example

```curl
curl https://taskloader.com/api/v1/tasks/task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/comments \
  -H "Authorization: Bearer $TASKLOADER_API_KEY"
```

```js
const response = await fetch('https://taskloader.com/api/v1/tasks/task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/comments', {
  headers: {
    Authorization: `Bearer ${process.env.TASKLOADER_API_KEY}`,
  },
});
if (!response.ok) {
  const problem = await response.json();
  throw new Error(`${problem.code}: ${problem.detail}`);
}
const comments = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://taskloader.com/api/v1/tasks/task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/comments",
    headers={
        "Authorization": f"Bearer {os.environ['TASKLOADER_API_KEY']}",
    },
    timeout=30,
)
if not response.ok:
    problem = response.json()
    raise RuntimeError(f"{problem['code']}: {problem['detail']}")
comments = response.json()
```

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "object": "list",
  "data": [
    {
      "object": "comment",
      "id": "cmt_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "taskId": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "task": {
        "id": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
        "key": "TL-012",
        "ref": "northwind/website-launch/TL-012",
        "title": "Write the launch announcement"
      },
      "body": "The draft is in the shared folder. Can someone check the dates?",
      "author": {
        "userId": "usr_kq3Xb1W9pZ0aLm7c",
        "name": "Maya Chen"
      },
      "via": {
        "channel": "web",
        "label": null
      },
      "createdAt": "2026-11-18T10:00:00.123Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```

## Comment on a task {#add_comment}

Adds a comment to a task’s history and returns it.

```http
POST /api/v1/tasks/{taskId}/comments
```

- **Scopes:** `comments:write`
- **Who:** Viewer or above in the project
- **[Project-limited credentials](https://taskloader.com/docs/authentication.md#project-limited-credentials):** allowed inside the credential’s projects; anything else is `not_found`
- **Retries:** send `Idempotency-Key` to make retries safe
- **Rate limit:** the `write` bucket
- **MCP tool:** `add_comment`

Adds a comment, 1 to 5,000 characters of plain text with line breaks, to a task. Viewers can comment too. It appears in the task’s history in the app, attributed to you and the app or key you used. Send an Idempotency-Key so a retry never posts it twice.

#### Parameters

| Name              | In     | Type          | Required | Description                                                                                                                                                                                                                                                       |
| ----------------- | ------ | ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskId`          | path   | id (`task_…`) | Yes      | Task id: task_ followed by 32 lowercase hex digits, for example task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718.                                                                                                                                                            |
| `Idempotency-Key` | header | string        | No       | Makes a retry safe: the same key with the same request within 24 hours returns the first answer (with `Idempotent-Replayed: true`) instead of acting twice. 1 to 255 printable ASCII characters; a UUID works well. Keys belong to the credential that sent them. |

#### Request body

A JSON object. Fields not listed are refused.

| Field  | Type   | Required | Description                                                   |
| ------ | ------ | -------- | ------------------------------------------------------------- |
| `body` | string | Yes      | The comment: plain text with line breaks, 1–5,000 characters. |

#### Response

`201` with the new `Comment` object.

| Field       | Type               | Description                                                                                                                                        |
| ----------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `object`    | `"comment"`        |                                                                                                                                                    |
| `id`        | id (`cmt_…`)       | Comment id: cmt_ followed by 32 lowercase hex digits, for example cmt_0b6f1d2a8c9e4f00a1b2c3d4e5f60718.                                            |
| `taskId`    | id (`task_…`)      | Task id: task_ followed by 32 lowercase hex digits, for example task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718.                                             |
| `task`      | object or null     | The task it is on, with its ref to cite. null when your credential may comment but not see tasks (it lacks tasks:read): then only taskId names it. |
| `body`      | string             | What the person wrote, as plain text with line breaks.                                                                                             |
| `author`    | object             | Who wrote it.                                                                                                                                      |
| `via`       | Via                |                                                                                                                                                    |
| `createdAt` | string (date-time) | RFC 3339 UTC with milliseconds, for example 2026-11-18T10:00:00.123Z.                                                                              |

Headers it sends: `Idempotent-Replayed`.

#### Errors

| Status | Code                                                                          | Meaning                                          |
| ------ | ----------------------------------------------------------------------------- | ------------------------------------------------ |
| 400    | [`invalid_id`](https://taskloader.com/docs/api/errors.md#invalid_id)                                   | The id is for a different kind of resource       |
| 400    | [`invalid_idempotency_key`](https://taskloader.com/docs/api/errors.md#invalid_idempotency_key)         | The Idempotency-Key header is not valid          |
| 403    | [`insufficient_scope`](https://taskloader.com/docs/api/errors.md#insufficient_scope)                   | The credential lacks the required access         |
| 404    | [`not_found`](https://taskloader.com/docs/api/errors.md#not_found)                                     | Not found                                        |
| 409    | [`idempotency_key_in_progress`](https://taskloader.com/docs/api/errors.md#idempotency_key_in_progress) | The original request is still running            |
| 413    | [`payload_too_large`](https://taskloader.com/docs/api/errors.md#payload_too_large)                     | The request body is too large                    |
| 415    | [`unsupported_media_type`](https://taskloader.com/docs/api/errors.md#unsupported_media_type)           | Unsupported media type                           |
| 422    | [`idempotency_key_reused`](https://taskloader.com/docs/api/errors.md#idempotency_key_reused)           | The Idempotency-Key was used for another request |

And the errors every operation can return: [`invalid_request`](https://taskloader.com/docs/api/errors.md#invalid_request), [`validation_failed`](https://taskloader.com/docs/api/errors.md#validation_failed), [`token_in_url`](https://taskloader.com/docs/api/errors.md#token_in_url), [`unauthenticated`](https://taskloader.com/docs/api/errors.md#unauthenticated), [`invalid_token`](https://taskloader.com/docs/api/errors.md#invalid_token), [`rate_limited`](https://taskloader.com/docs/api/errors.md#rate_limited), [`internal_error`](https://taskloader.com/docs/api/errors.md#internal_error), [`service_unavailable`](https://taskloader.com/docs/api/errors.md#service_unavailable).

#### Example

```curl
curl https://taskloader.com/api/v1/tasks/task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/comments \
  -H "Authorization: Bearer $TASKLOADER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "body": "The draft is in the shared folder. Can someone check the dates?"
}'
```

```js
const response = await fetch('https://taskloader.com/api/v1/tasks/task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/comments', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TASKLOADER_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    body: 'The draft is in the shared folder. Can someone check the dates?',
  }),
});
if (!response.ok) {
  const problem = await response.json();
  throw new Error(`${problem.code}: ${problem.detail}`);
}
const comment = await response.json();
```

```python
import os
import uuid

import requests

response = requests.post(
    "https://taskloader.com/api/v1/tasks/task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/comments",
    headers={
        "Authorization": f"Bearer {os.environ['TASKLOADER_API_KEY']}",
        "Content-Type": "application/json",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "body": "The draft is in the shared folder. Can someone check the dates?",
    },
    timeout=30,
)
if not response.ok:
    problem = response.json()
    raise RuntimeError(f"{problem['code']}: {problem['detail']}")
comment = response.json()
```

```http
HTTP/1.1 201 Created
Content-Type: application/json

{
  "object": "comment",
  "id": "cmt_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
  "taskId": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
  "task": {
    "id": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
    "key": "TL-012",
    "ref": "northwind/website-launch/TL-012",
    "title": "Write the launch announcement"
  },
  "body": "The draft is in the shared folder. Can someone check the dates?",
  "author": {
    "userId": "usr_kq3Xb1W9pZ0aLm7c",
    "name": "Maya Chen"
  },
  "via": {
    "channel": "web",
    "label": null
  },
  "createdAt": "2026-11-18T10:00:00.123Z"
}
```
