# Comments

A task's comments, as projqo's document JSON or Markdown.

## List a task's comments

`GET /orgs/{org}/tasks/{task}/comments`

Scope: `tasks:read`

The task's comments the token's person can see, oldest first (sort=-created for newest first), replies with their thread_id. A comment limited to a project role or a group is left out for people outside it, as in the app. Bodies come as projqo's document JSON, or as Markdown with body_format=markdown.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `task` (string, required): A task's id, or its key (WEB-12). [1 to 60 characters]

### Query parameters

- `limit` (integer): How many items a page holds, 1 to 200. [from 1 to 200; default 50]
- `cursor` (string): The next_cursor of the previous page; leave it out for the first page. [at most 1000 characters]
- `count` (string): true adds total, the number of items in the whole list. [one of: true, false]
- `sort` (string): created or -created. [at most 100 characters]
- `updated_since` (string (date-time)): Only items changed at or after this time (with Z or an offset).
- `body_format` (string): How rich text (descriptions, comments) comes back: document (projqo's document JSON, the default) or markdown. [one of: document, markdown]
- `fields` (string): Only these fields, comma-separated: id, task, thread_id, author, body, created_at, edited_at, edited_by, visibility, via, reactions, can. id always comes; the fields not asked for are left out, required or not.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/tasks/{task}/comments" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
      "task": {
        "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
        "key": "WEB-12",
        "summary": "Fix the sign-in page"
      },
      "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
      "author": {
        "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
        "name": "Priya Shah"
      },
      "body": "Checked on the [@Sam Lee](https://projqo.example/o/acme/people/7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f) build: done.\n",
      "created_at": "2026-12-01T10:15:00.000Z",
      "edited_at": null,
      "edited_by": null,
      "visibility": null,
      "via": "app",
      "reactions": [
        {
          "emoji": "👍",
          "count": 2,
          "mine": false
        }
      ],
      "can": {
        "reply": true,
        "edit": true,
        "delete": true
      }
    }
  ],
  "next_cursor": null
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Add a comment

`POST /orgs/{org}/tasks/{task}/comments`

Scope: `tasks:write`

Adds a comment to the task, or a reply with reply_to, as the token's person: it needs "Add comments" in the project, as in the app. The body is projqo's document JSON or Markdown; people mentioned (as mention nodes, or in Markdown as [@Name](<the person's address>)) are told when they can see the comment. Commenting watches the task while the person's auto-watch is on.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `task` (string, required): A task's id, or its key (WEB-12). [1 to 60 characters]

### Query parameters

- `body_format` (string): How rich text (descriptions, comments) comes back: document (projqo's document JSON, the default) or markdown. [one of: document, markdown]

### Headers

- `Idempotency-Key` (string): A unique key (such as a uuid): the same key and body within 24 hours gets the first answer again without a second create; another body gets 422. [1 to 200 characters]

### Body

- `body` (one of 2 shapes, required): A document (projqo's document JSON), or Markdown as a string.
- `reply_to` (string (uuid)): Reply to this comment (its thread); replies are one level deep.
- `role_id` (string (uuid)): Organisation projects: limit the comment to a project role the person holds (not for replies: a reply keeps its thread's).
- `group_id` (string (uuid)): With the organisation's "Groups and roles" comment setting: limit it to a group the person is in.

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/tasks/{task}/comments" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "body": "string",
  "reply_to": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10",
  "role_id": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10",
  "group_id": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10"
}'
```

### Answer: 201

```json
{
  "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "task": {
    "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
    "key": "WEB-12",
    "summary": "Fix the sign-in page"
  },
  "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "author": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "body": "Checked on the [@Sam Lee](https://projqo.example/o/acme/people/7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f) build: done.\n",
  "created_at": "2026-12-01T10:15:00.000Z",
  "edited_at": null,
  "edited_by": null,
  "visibility": null,
  "via": "app",
  "reactions": [
    {
      "emoji": "👍",
      "count": 2,
      "mine": false
    }
  ],
  "can": {
    "reply": true,
    "edit": true,
    "delete": true
  }
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `archived`: archived: The item (or its project) is archived, so it can't be changed.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 422 `idempotency_key_reused`: idempotency_key_reused: The same Idempotency-Key was sent within 24 hours with a different body.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Get a comment

`GET /orgs/{org}/tasks/{task}/comments/{comment}`

Scope: `tasks:read`

One comment of the task. A comment the person can't see (limited to a role or group they're outside) answers 404, as a missing one.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `task` (string, required): A task's id, or its key (WEB-12). [1 to 60 characters]
- `comment` (string (uuid), required): The comment's id.

### Query parameters

- `body_format` (string): How rich text (descriptions, comments) comes back: document (projqo's document JSON, the default) or markdown. [one of: document, markdown]
- `fields` (string): Only these fields, comma-separated: id, task, thread_id, author, body, created_at, edited_at, edited_by, visibility, via, reactions, can. id always comes; the fields not asked for are left out, required or not.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/tasks/{task}/comments/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "task": {
    "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
    "key": "WEB-12",
    "summary": "Fix the sign-in page"
  },
  "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "author": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "body": "Checked on the [@Sam Lee](https://projqo.example/o/acme/people/7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f) build: done.\n",
  "created_at": "2026-12-01T10:15:00.000Z",
  "edited_at": null,
  "edited_by": null,
  "visibility": null,
  "via": "app",
  "reactions": [
    {
      "emoji": "👍",
      "count": 2,
      "mine": false
    }
  ],
  "can": {
    "reply": true,
    "edit": true,
    "delete": true
  }
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Edit a comment

`PATCH /orgs/{org}/tasks/{task}/comments/{comment}`

Scope: `tasks:write`

Changes the comment's body: your own with "Edit own comments", anyone's with "Edit all comments", as in the app. Newly mentioned people are told.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `task` (string, required): A task's id, or its key (WEB-12). [1 to 60 characters]
- `comment` (string (uuid), required): The comment's id.

### Query parameters

- `body_format` (string): How rich text (descriptions, comments) comes back: document (projqo's document JSON, the default) or markdown. [one of: document, markdown]

### Body

- `body` (one of 2 shapes, required): A document (projqo's document JSON), or Markdown as a string.

### Request

```sh
curl -X PATCH "https://projqo.example/api/v1/orgs/{org}/tasks/{task}/comments/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "body": "string"
}'
```

### Answer: 200

```json
{
  "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "task": {
    "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
    "key": "WEB-12",
    "summary": "Fix the sign-in page"
  },
  "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "author": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "body": "Checked on the [@Sam Lee](https://projqo.example/o/acme/people/7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f) build: done.\n",
  "created_at": "2026-12-01T10:15:00.000Z",
  "edited_at": null,
  "edited_by": null,
  "visibility": null,
  "via": "app",
  "reactions": [
    {
      "emoji": "👍",
      "count": 2,
      "mine": false
    }
  ],
  "can": {
    "reply": true,
    "edit": true,
    "delete": true
  }
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `archived`: archived: The item (or its project) is archived, so it can't be changed.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Delete a comment

`DELETE /orgs/{org}/tasks/{task}/comments/{comment}`

Scope: `tasks:write`

Deletes the comment (a thread's first comment goes with its replies): your own with "Delete own comments", anyone's with "Delete all comments", as in the app.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `task` (string, required): A task's id, or its key (WEB-12). [1 to 60 characters]
- `comment` (string (uuid), required): The comment's id.

### Request

```sh
curl -X DELETE "https://projqo.example/api/v1/orgs/{org}/tasks/{task}/comments/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 204

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `archived`: archived: The item (or its project) is archived, so it can't be changed.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).
