# Docs pages

A space's page tree; pages read and written as projqo's document JSON or Markdown, with version checks and publishing; move, copy, the trash and restore, versions, and the deleted-pages feed.

## List a level of a space's tree

`GET /orgs/{org}/spaces/{space}/pages`

Scope: `docs:read`

The space's tree, one level at a time in its order, as the sidebar shows it: the top level, or the children of parent. Drafts are listed for their author only; archived items and blog posts aren't in the tree; a page a view restriction keeps from the person isn't listed, nor anything under it.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `space` (string, required): A space's key (an old key still finds it) or id. [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]
- `parent` (string (uuid)): A page of the space: its children. Leave it out for the top level.
- `fields` (string): Only these fields, comma-separated: id, kind, title, emoji, draft, parent_id, has_children, updated_at, created_by. 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}/spaces/{space}/pages" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "kind": "page",
      "title": "Release checklist",
      "emoji": "✅",
      "draft": false,
      "parent_id": null,
      "has_children": true,
      "updated_at": "2026-12-01T10:15:00.000Z",
      "created_by": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a"
    }
  ],
  "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).

## Create a page

`POST /orgs/{org}/spaces/{space}/pages`

Scope: `docs:write`

Creates a page (or a live doc, folder or smart link, where the space's features allow them) as the token's person, under parent_id or at the top of the space: it needs "Add pages" in the space. A page is published as its version 1 unless publish is false, which keeps it a draft only its author sees. The body is projqo's document JSON or Markdown.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `space` (string, required): A space's key (an old key still finds it) or id. [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

- `kind` (string) [one of: page, live_doc, folder, smart_link]
- `title` (string) [1 to 255 characters]
- `parent_id` (string (uuid) or null)
- `body` (one of 2 shapes): A document (projqo's document JSON), or Markdown as a string.
- `url` (string): A smart link's address. [at most 2048 characters]
- `publish` (boolean): Pages: publish it now (true by default), or keep it as your draft.
- `comment` (string): What changed, for the version history (at most 500 characters). [at most 500 characters]
- `notify` (boolean): Tell the page's watchers (true by default, as the publish dialog).

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/spaces/{space}/pages" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "page",
  "title": "string",
  "parent_id": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10",
  "body": "string",
  "url": "string",
  "publish": true,
  "comment": "string",
  "notify": true
}'
```

### Answer: 201

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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).

## List deleted pages

`GET /orgs/{org}/pages/deleted`

Scope: `docs:read`

Pages and other items moved to their space's trash since a time (with everything that went with them), and items restored from it, oldest first: a client keeping a copy drops and adds them. Each row reaches the people who could open the item then (organisation owners and admins read every row). Items purged from the trash were already listed when they went to it.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 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]
- `since` (string (date-time)): Only rows at or after this time (with Z or an offset).
- `fields` (string): Only these fields, comma-separated: page_id, space_id, kind, title, action, at, by. 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/deleted" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "page_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "space_id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
      "kind": "page",
      "title": "Old notes",
      "action": "trashed",
      "at": "2026-12-01T10:15:00.000Z",
      "by": {
        "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
        "name": "Priya Shah"
      }
    }
  ],
  "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).

## Get a page

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

Scope: `docs:read`

A page with its body, as the page view shows it: the published version (a live doc's live body), or with status=draft the draft it is being edited in (people who can edit it). Bodies come as projqo's document JSON, or as Markdown with body_format=markdown. A page the person can't open (a view restriction, someone else's draft) answers 404, as a missing one.

### 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]
- `status` (string): published (the default) or draft (the draft being edited; editors only). [one of: published, draft]
- `fields` (string): Only these fields, comma-separated: id, kind, title, emoji, space, parent_id, state, archived, version, published, unpublished_changes, owner, created_by, created_at, updated_at, labels, restrictions, url, body, 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" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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.
- 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).

## Change a page

`PATCH /orgs/{org}/pages/{page}`

Scope: `docs:write`

Changes the page's title and body from the version you read, and publishes it as the next version (unless publish is false, which leaves it as unpublished changes). version is the version you read (0 for a page never published): when the page has been published since, or its editor holds changes nobody has published yet (someone may be editing it now), the answer is 409 conflict and nothing changes, so your update never writes over anyone's text. The change goes through live editing: people with the page open in the editor see it at once. It needs edit rights on the page, as in the app (an edit restriction lists who may). A live doc changes in its editor only. Folders and smart links take a title (and emoji).

### 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]

### Body

- `version` (integer): The version you read (0 for a page never published). Needed when the title or body changes. [at least 0]
- `title` (string) [1 to 255 characters]
- `emoji` (string or null)
- `body` (one of 2 shapes): A document (projqo's document JSON), or Markdown as a string.
- `publish` (boolean): Publish the change as the next version (true by default).
- `comment` (string): What changed, for the version history (at most 500 characters). [at most 500 characters]
- `notify` (boolean): Tell the page's watchers (true by default, as the publish dialog).

### Request

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

### Answer: 200

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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 page

`DELETE /orgs/{org}/pages/{page}`

Scope: `docs:delete`

Moves the page and everything under it to its space's trash, as the app's Delete does: your own with "Delete own pages", anyone's with "Delete any page". The space's home page can't be deleted. Space admins restore it from the trash or delete it for good; the deleted-pages feed lists it.

### 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).

### Request

```sh
curl -X DELETE "https://projqo.example/api/v1/orgs/{org}/pages/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).

## Publish a page

`POST /orgs/{org}/pages/{page}/publish`

Scope: `docs:write`

Publishes the page's draft as its next version, as the editor's Publish does: a draft page for the first time (parent_id places it), or a published page's unpublished changes. It needs edit rights on the page; a space that requires approval publishes only after one (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).

### 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

- `comment` (string): What changed, for the version history (at most 500 characters). [at most 500 characters]
- `notify` (boolean): Tell the page's watchers (true by default, as the publish dialog).
- `parent_id` (string (uuid) or null): A first publish only: where the page goes (null: the top).

### Request

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

### Answer: 200

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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).

## Move a page

`POST /orgs/{org}/pages/{page}/move`

Scope: `docs:write`

Moves the page and everything under it, as dragging it in the tree or Move does: under parent_id (null: the top of the space), before before_id or last, and into another space with space ("Add pages" there; "Edit pages" in both).

### 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]

### Body

- `space` (string): Another space to move it to. [1 to 60 characters]
- `parent_id` (string (uuid) or null, required)
- `before_id` (string (uuid) or null): Place it just before this item of the same level; last when left out.

### Request

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

### Answer: 200

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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).

## Copy a page

`POST /orgs/{org}/pages/{page}/copy`

Scope: `docs:write`

Copies the page (with its children when asked, up to 500 items) under parent_id in space (this one when left out), as the app's Copy does: it needs "Add pages" there. The copy is published, sits first under its parent and is called "Copy of …" unless a title is given; with include_restrictions, the pages' restrictions come too where the person manages access.

### 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

- `space` (string): A space's key (an old key still finds it) or id. [1 to 60 characters]
- `parent_id` (string (uuid) or null, required)
- `title` (string) [1 to 255 characters]
- `include_children` (boolean)
- `include_restrictions` (boolean)

### Request

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

### Answer: 201

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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).

## List a page's versions

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

Scope: `docs:read`

The page's published versions, newest first, as its version history shows them: who published each and when, its comment, and the version a restore came from.

### 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]
- `fields` (string): Only these fields, comma-separated: id, number, title, published_at, published_by, comment, restored_from, current. 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/versions" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
      "number": 3,
      "title": "Release checklist",
      "published_at": "2026-12-01T10:15:00.000Z",
      "published_by": {
        "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
        "name": "Priya Shah"
      },
      "comment": "Added the tagging step",
      "restored_from": null,
      "current": 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).

## Get a version of a page

`GET /orgs/{org}/pages/{page}/versions/{version}`

Scope: `docs:read`

One published version of the page, by its number or id, with its title and body.

### 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).
- `version` (string, required): The version's number (3) or id. [1 to 40 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]
- `fields` (string): Only these fields, comma-separated: id, number, title, published_at, published_by, comment, restored_from, current, body. 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/versions/{version}" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
  "number": 3,
  "title": "Release checklist",
  "published_at": "2026-12-01T10:15:00.000Z",
  "published_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "comment": "Added the tagging step",
  "restored_from": null,
  "current": true,
  "body": "# Release checklist\n"
}
```

### 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).

## Restore a version

`POST /orgs/{org}/pages/{page}/versions/{version}/restore`

Scope: `docs:write`

Makes a new current version with that version's title and body, as Restore in the version history does (edit rights on the page). Access settings stay as they are.

### 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).
- `version` (string, required): The version's number (3) or id. [1 to 40 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]

### Body

- `comment` (string) [at most 500 characters]

### Request

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

### Answer: 200

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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).

## List a space's trash

`GET /orgs/{org}/spaces/{space}/trash`

Scope: `docs:read`

The items deleted on their own in the space, newest first (each with what went with it), as the space's Trash settings page shows them: for space admins ("Manage all content"); to anyone else it answers 404, as the app hides the page.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `space` (string, required): A space's key (an old key still finds it) or id. [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]
- `fields` (string): Only these fields, comma-separated: id, kind, title, trashed_at, trashed_by. 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}/spaces/{space}/trash" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "kind": "page",
      "title": "Old notes",
      "trashed_at": "2026-12-01T10:15:00.000Z",
      "trashed_by": {
        "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
        "name": "Priya Shah"
      }
    }
  ],
  "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).

## Restore from the trash

`POST /orgs/{org}/spaces/{space}/trash/{page}/restore`

Scope: `docs:write`

Restores a trashed item and what went with it, back where it was (or at the top of the space when its parent is gone), as the Trash page's Restore does: space admins. The deleted-pages feed lists it as restored.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `space` (string, required): A space's key (an old key still finds it) or id. [1 to 60 characters]
- `page` (string (uuid), required): A trashed item'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]

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/spaces/{space}/trash/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/restore" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "kind": "page",
  "title": "Release checklist",
  "emoji": "✅",
  "space": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "key": "HANDBOOK",
    "name": "Handbook"
  },
  "parent_id": null,
  "state": "published",
  "archived": false,
  "version": 3,
  "published": {
    "at": "2026-12-01T10:15:00.000Z",
    "by": {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah"
    }
  },
  "unpublished_changes": false,
  "owner": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_by": {
    "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
    "name": "Priya Shah"
  },
  "created_at": "2026-11-20T09:00:00.000Z",
  "updated_at": "2026-12-01T10:15:00.000Z",
  "labels": [
    "release"
  ],
  "restrictions": {
    "view": false,
    "edit": false
  },
  "url": null,
  "body": "# Release checklist\n\n- [ ] Tag the build\n",
  "can": {
    "edit": true,
    "delete": true,
    "comment": 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.
- 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 for good

`DELETE /orgs/{org}/spaces/{space}/trash/{page}`

Scope: `docs:delete`

Deletes a trashed item and what went with it for good, with their files, as the Trash page's Delete does: space admins. It can't be undone.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `space` (string, required): A space's key (an old key still finds it) or id. [1 to 60 characters]
- `page` (string (uuid), required): A trashed item's id.

### Request

```sh
curl -X DELETE "https://projqo.example/api/v1/orgs/{org}/spaces/{space}/trash/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).
