# Docs comments

A page's comments: footer comments to read, add, edit and delete; inline ones to read.

## List a page's comments

`GET /orgs/{org}/pages/{page}/comments`

Scope: `docs:read`

The page's comments, oldest first: footer comments and inline ones (kind), replies with their thread_id. Bodies come as projqo's document JSON, or as Markdown with body_format=markdown. A page the person can't open answers 404.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `page` (string (uuid), required): A page's id (any item of the tree: page, live doc, folder, smart link).

### 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]
- `kind` (string) [one of: footer, inline]
- `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, page, thread_id, kind, quote, anchor_gone, author, text, body, resolved, created_at, edited_at, 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}/pages/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/comments" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
      "page": {
        "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
        "title": "Release checklist"
      },
      "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
      "kind": "footer",
      "quote": null,
      "anchor_gone": false,
      "author": {
        "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
        "name": "Priya Shah"
      },
      "text": "Looks good to me.",
      "body": "Looks good to me.\n",
      "resolved": false,
      "created_at": "2026-12-01T10:15:00.000Z",
      "edited_at": null,
      "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}/pages/{page}/comments`

Scope: `docs:write`

Adds a footer comment to the page, or a reply in a footer thread with reply_to, as the token's person: it needs "Add comments" in the space and a published page, as in the app. People mentioned are told when they can open the page; the page's watchers hear of it; commenting watches the page 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]
- `page` (string (uuid), required): A page's id (any item of the tree: page, live doc, folder, smart link).

### 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 in this comment's thread (a footer thread).

### Request

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

### Answer: 201

```json
{
  "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "page": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "title": "Release checklist"
  },
  "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "kind": "footer",
  "quote": null,
  "anchor_gone": false,
  "author": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "text": "Looks good to me.",
  "body": "Looks good to me.\n",
  "resolved": false,
  "created_at": "2026-12-01T10:15:00.000Z",
  "edited_at": null,
  "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. conflict: The thing changed since it was read, or the change clashes with its state.
- 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}/pages/{page}/comments/{comment}`

Scope: `docs:read`

One comment of the page, footer or inline.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `page` (string (uuid), required): A page's id (any item of the tree: page, live doc, folder, smart link).
- `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, page, thread_id, kind, quote, anchor_gone, author, text, body, resolved, created_at, edited_at, 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}/pages/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/comments/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "page": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "title": "Release checklist"
  },
  "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "kind": "footer",
  "quote": null,
  "anchor_gone": false,
  "author": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "text": "Looks good to me.",
  "body": "Looks good to me.\n",
  "resolved": false,
  "created_at": "2026-12-01T10:15:00.000Z",
  "edited_at": null,
  "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}/pages/{page}/comments/{comment}`

Scope: `docs:write`

Changes a footer comment's body: its author, while they may still comment on the page, as in the app. Newly mentioned people are told. Inline comments are read only here (409 conflict).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `page` (string (uuid), required): A page's id (any item of the tree: page, live doc, folder, smart link).
- `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}/pages/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/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",
  "page": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "title": "Release checklist"
  },
  "thread_id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
  "kind": "footer",
  "quote": null,
  "anchor_gone": false,
  "author": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "text": "Looks good to me.",
  "body": "Looks good to me.\n",
  "resolved": false,
  "created_at": "2026-12-01T10:15:00.000Z",
  "edited_at": null,
  "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. conflict: The thing changed since it was read, or the change clashes with its state.
- 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}/pages/{page}/comments/{comment}`

Scope: `docs:write`

Deletes a footer comment (a thread's first comment goes with its replies): your own with "Delete own comments", anyone's with "Delete any comments", as in the app. Inline comments are read only here (409 conflict).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `page` (string (uuid), required): A page's id (any item of the tree: page, live doc, folder, smart link).
- `comment` (string (uuid), required): The comment's id.

### Request

```sh
curl -X DELETE "https://projqo.example/api/v1/orgs/{org}/pages/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/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. conflict: The thing changed since it was read, or the change clashes with its state.
- 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).
