# Docs

Read doc pages, their published revisions and versions. The document-space operations are listed for the apps.

5 operation(s) for tokens, 112 app-only. The full schemas are in [openapi.json](https://docs.youniton.com/openapi.json) (search the operation ID).

## The page for the reading pane — head version (or published revision), tag, publication and affordances

`GET /doc-pages/{pageId}`

- Operation ID: `getDocPage`
- Call with: Personal access token, ability `docs:read`
- Feature: F-DOC-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | no | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The page; ETag carries its aggregate version. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The page's published revisions, newest first

`GET /doc-pages/{pageId}/revisions`

- Operation ID: `listDocRevisions`
- Call with: Personal access token, ability `docs:read`
- Feature: F-DOC-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | no | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of revisions. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The page's retained versions, newest first, with the revisions that bind them

`GET /doc-pages/{pageId}/versions`

- Operation ID: `listDocPageVersions`
- Call with: Personal access token, ability `docs:read`
- Feature: F-DOC-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | no | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of versions. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One version's frozen title and body

`GET /doc-pages/{pageId}/versions/{number}`

- Operation ID: `getDocPageVersion`
- Call with: Personal access token, ability `docs:read`
- Feature: F-DOC-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | no | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `number` | path | integer | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The version. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One level of the project's page tree (the top level, or one parent's children)

`GET /projects/{projectKey}/doc-pages`

- Operation ID: `listDocTreeLevel`
- Call with: Personal access token, ability `docs:read`
- Feature: F-DOC-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | no | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes |  |
| `parentId` | query | string (uuid) | no | Omit for the top level. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The level's live nodes in tree order with counts and the subtitle facts. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The team's doc edits of the last 7 days and the 7 days before, with the latest edited pages (the Documents sidebar)

`GET /doc-activity`

- Operation ID: `getDocActivity`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The edit summary under the reader's draft read. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Apply or reject an agent's pending change

`POST /doc-agent-changes/{changeId}/decision`

- Operation ID: `decideDocAgentChange`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-24

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `changeId` | path | string (uuid) | yes |  |

Request body (application/json, required): `DocAgentChangeDecision`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The change after the decision. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The readable pages that link to a ticket, a knowledge item, an opportunity or a request

`GET /doc-backlinks`

- Operation ID: `listDocBacklinksForTarget`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `targetKind` | query | string | yes |  |
| `targetRef` | query | string | yes | A ticket key, a knowledge item key, an opportunity id or a request key. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of backlinks. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One thread with its comments, 100 per page

`GET /doc-comment-threads/{threadId}`

- Operation ID: `getDocCommentThread`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `threadId` | path | string (uuid) | yes |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The thread. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Reply in a thread (and reopen a resolved one when asked)

`POST /doc-comment-threads/{threadId}/comments`

- Operation ID: `postDocComment`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `threadId` | path | string (uuid) | yes |  |

Request body (application/json, required): `DocCommentRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new comment. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Reopen a resolved thread

`POST /doc-comment-threads/{threadId}/reopen`

- Operation ID: `reopenDocCommentThread`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `threadId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The thread, open or orphaned. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Resolve a thread

`POST /doc-comment-threads/{threadId}/resolve`

- Operation ID: `resolveDocCommentThread`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `threadId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The resolved thread. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Delete an own comment, or remove one as a space admin

`DELETE /doc-comments/{commentId}`

- Operation ID: `deleteDocComment`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `commentId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The comment is a tombstone. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Edit an own comment

`PATCH /doc-comments/{commentId}`

- Operation ID: `editDocComment`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `commentId` | path | string (uuid) | yes |  |

Request body (application/json, required): `DocCommentRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The edited comment. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Move the node and its children to the trash, exactly as previewed

`DELETE /doc-pages/{pageId}`

- Operation ID: `deleteDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `previewed` | query | string | no | The comma-separated page ids of the deletion preview (1–501). Exactly one of previewed and previewDigest; previewDigest is required above 501 pages (Spec DS-1, F-DOC-13.R20). Neither, both or more than 501 ids answer 422 validation.failed with doc_page.preview_missing; a malformed id or a list form answers 400 query.invalid. |
| `previewDigest` | query | string | no | Spec DS-1 — the previewDigest of the deletion preview (F-DOC-13.R20), as the preview gives it. A malformed digest or a list form answers 400 query.invalid. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The batch is in the trash. |  |  |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Change the title, meeting date or child order (never the body)

`PATCH /doc-pages/{pageId}`

- Operation ID: `renameDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/merge-patch+json, required): `DocPagePatch`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The page; a title change carries the retitle version as the head when one was recorded. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## A tenant Admin opens a page outside its audience — an explicit act, audited with a reason (register §76)

`POST /doc-pages/{pageId}/admin-access`

- Operation ID: `openDocPageAsAdmin`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-12

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocResetRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The page as the Admin may read it for this purpose. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The files attached to a page, with their state and where they are used

`GET /doc-pages/{pageId}/attachments`

- Operation ID: `listDocPageAttachments`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-17

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attachments. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Bind an uploaded file (purpose attachment, target doc_page) to the page

`POST /doc-pages/{pageId}/attachments`

- Operation ID: `attachFileToDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-17

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocAttachRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The file was already attached; the existing attachment. | application/json | `object` |
| 201 | The attachment. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Detach a file that no current published revision references

`DELETE /doc-pages/{pageId}/attachments/{fileId}`

- Operation ID: `detachFileFromDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-17

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `fileId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The file is detached. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The readable pages that link to this page

`GET /doc-pages/{pageId}/backlinks`

- Operation ID: `listDocPageBacklinks`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of backlinks. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Apply a new body (rich text or Markdown) to a page's draft as one recorded version, from a named base

`PUT /doc-pages/{pageId}/body`

- Operation ID: `writeDocPageBody`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-24

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocBodyWriteRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The outcome and the recorded version. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 413 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## What tagging this page would show to which client, now

`GET /doc-pages/{pageId}/client-tag`

- Operation ID: `getDocClientTagConsequence`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The current client organisation and version, whether a revision becomes visible at once, and the guest count. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Share the page with the project's client (stamped) or stop sharing it

`PUT /doc-pages/{pageId}/client-tag`

- Operation ID: `setDocClientTag`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocClientTagRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The page with its tag state; unchanged when the request matched the current state. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Open a document session (write or watch) and receive a short-lived token for the collaboration server

`POST /doc-pages/{pageId}/collab-sessions`

- Operation ID: `openDocSession`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-06

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocSessionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The grant; mode may be narrower than requested, with the reason. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Re-decide access and receive a fresh single-use token with the current mode

`POST /doc-pages/{pageId}/collab-sessions/{sessionId}/renew`

- Operation ID: `renewDocSession`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-07

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `sessionId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A fresh grant; the mode may be narrower than before. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## A page's comment threads by state, newest activity first

`GET /doc-pages/{pageId}/comment-threads`

- Operation ID: `listDocCommentThreads`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `state` | query | string | no |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of threads. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Open a page-level or an inline comment thread with its first comment

`POST /doc-pages/{pageId}/comment-threads`

- Operation ID: `openDocCommentThread`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocThreadCreateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new thread; an inline thread is open, and orphaned when a recorded version does not hold its mark. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Copy a page, with or without its children, to a parent of any space the member can edit

`POST /doc-pages/{pageId}/copy`

- Operation ID: `copyDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocCopyRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The copy's root page and the page count; subtreeJob is present when a job finishes a large copy. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The exact pages a delete would trash that the reader can read, with the tagged count, the restore deadline and the blockers

`GET /doc-pages/{pageId}/deletion-preview`

- Operation ID: `previewDocPageDeletion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The preview. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Admin repair — start a new epoch of the draft from the head version, fencing the old one

`POST /doc-pages/{pageId}/draft/reset`

- Operation ID: `resetDocDraft`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-08

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocResetRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The epoch advanced and sessions closed; the reset version follows when the server confirms. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Duplicate a page: the page alone as "<title> (copy)", right after the original

`POST /doc-pages/{pageId}/duplicate`

- Operation ID: `duplicateDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

Owner Q5 (24 Nov 2026, register §230 add. 100). The edit right on the page; a page only (409 doc_page.not_duplicable for a section or a whiteboard). The copy is not shared with a client and not published (register §75); it has no comments, versions, watchers or attachments of the original; its creator watches it. Its body — the original's current body, with copies of the files the body shows — arrives after the commit.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The copy, untagged and without a version yet. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One page's Git conflict with the Git body

`GET /doc-pages/{pageId}/git-conflict`

- Operation ID: `getDocGitConflict`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The conflict. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Keep Youniton's or Git's content for a page in conflict

`POST /doc-pages/{pageId}/git-conflict/resolve`

- Operation ID: `resolveDocGitConflict`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocGitConflictResolution`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The page after the resolution. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Keep a page and its subtree out of Git sync, or let them back in — the page owner or a project admin (register §76)

`PUT /doc-pages/{pageId}/git-exclusion`

- Operation ID: `setDocPageGitExclusion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocGitExclusionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The visibility view with keepOutOfGit. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The outgoing links of a page's latest version, each in its state for the reader

`GET /doc-pages/{pageId}/links`

- Operation ID: `listDocPageLinks`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The links; truncated is true when the version had more than 1,000 targets. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## A page's latest version or published revision as Markdown

`GET /doc-pages/{pageId}/markdown`

- Operation ID: `getDocPageMarkdown`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-24

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `source` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The page as Markdown. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## What a move of the page and its subtree would change — size, audience, blockers and depth

`GET /doc-pages/{pageId}/move-preview`

- Operation ID: `previewDocPageMove`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `spaceId` | query | string (uuid) | no |  |
| `parentId` | query | string (uuid) | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The preview. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Hand a page to another owner — the page owner or a project admin

`PUT /doc-pages/{pageId}/owner`

- Operation ID: `transferDocPageOwner`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-12

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocPageOwnerRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The visibility view with the new owner. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Move a node to a parent (or the top level) between two neighbours

`PUT /doc-pages/{pageId}/position`

- Operation ID: `moveDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocPagePositionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The node with its new parent and position. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set or clear one page's public flag

`PUT /doc-pages/{pageId}/public`

- Operation ID: `setDocPagePublic`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocPublicFlagRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The flag and whether the page is on the internet now. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Publish exactly the named version whose digest the dialog showed

`POST /doc-pages/{pageId}/publish`

- Operation ID: `publishDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json, required): `DocPublishRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new revision (200 with the current revision when that version is already published). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The doc page's presence channel, with the project's audience epoch (F-WRK-37)

`GET /doc-pages/{pageId}/realtime`

- Operation ID: `getDocPagePresenceChannel`
- Call with: Session of the Youniton apps (app only)
- Feature: F-WRK-37

`presence-tenant.{t}.project.{p}.doc.{page}.v{n}.a{m}` (R03a), opened like the page's read (`DocsGate::page`): a hidden page, a client audience or the Docs module off answer as the read does. Docs builds it.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The channel to join. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Restore the trashed batch this page belongs to

`POST /doc-pages/{pageId}/restore`

- Operation ID: `restoreDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

Request body (application/json): `DocTrashRestoreRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The restored nodes in their places that the restorer can read now (Spec DS-1, F-DOC-13.R21); empty with meta.subtreeJob when a subtree job finishes the restore. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Record a version of the draft now for the Publish dialog and answer it with its diff and outcome

`POST /doc-pages/{pageId}/versions`

- Operation ID: `recordDocVersionNow`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The answered version (recorded, unchanged, covered, or the head when superseded) with its diff against the current revision. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The block diff and the title change between two versions of a page

`GET /doc-pages/{pageId}/versions/compare`

- Operation ID: `compareDocPageVersions`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-19

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `from` | query | integer | yes |  |
| `to` | query | integer | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The diff. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Apply a version to the live draft as a new version, optionally publishing the result

`POST /doc-pages/{pageId}/versions/{number}/restore`

- Operation ID: `restoreDocPageVersion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `number` | path | integer | yes |  |

Request body (application/json): `DocRestoreRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The recording outcome, the answered version and whether it was published. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## A page's owner, own and inherited audience, edit restriction and client setting

`GET /doc-pages/{pageId}/visibility`

- Operation ID: `getDocPageVisibility`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-12

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The visibility view. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set a page's audience (kind view) or edit restriction (kind edit) — the page owner or a project admin, or a tenant Admin with an override reason

`PUT /doc-pages/{pageId}/visibility`

- Operation ID: `setDocPageAudience`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-12

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocRestrictionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The visibility view; subtreeJob is present when a job rewrites a large subtree. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Stop watching a page

`DELETE /doc-pages/{pageId}/watch`

- Operation ID: `unwatchDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

The caller stops watching the page; idempotent by state. The refusals are the ones of watchDocPage.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The member's watch state. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Watch a page

`PUT /doc-pages/{pageId}/watch`

- Operation ID: `watchDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

The caller (an internal member who can read the page) starts to watch it; idempotent by state, no If-Match and no Idempotency-Key. A hidden, foreign, trashed or unknown page and a client answer 404 doc_page.not_found; a preview answers 403 preview.read_only.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The member's watch state for the page and its space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Hide the page from clients until the next publication

`POST /doc-pages/{pageId}/withdraw-publication`

- Operation ID: `withdrawDocPublication`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The page with its publication state withdrawn. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Find pages by their words in one space or in every space the reader can read

`GET /doc-search`

- Operation ID: `searchDocs`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-18

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `q` | query | string | yes |  |
| `spaceId` | query | string (uuid) | no |  |
| `lastEditorId` | query | string (uuid) | no |  |
| `updatedFrom` | query | string (date) | no |  |
| `updatedTo` | query | string (date) | no |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of hits; meta.limitReached is true when more than 200 results exist. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The pages shared with clients across every project that the reader may see (the Documents sidebar)

`GET /doc-shared-pages`

- Operation ID: `listDocSharedPages`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `cursor` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The shared pages, newest share first, 50 per page. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The spaces the reader can read, with the reader's level

`GET /doc-spaces`

- Operation ID: `listDocSpaces`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `kind` | query | string | no |  |
| `q` | query | string | no | A part of the space's name, without regard to case. It applies in every lifecycle (live, archived and trash). |
| `lifecycle` | query | string | no | live (the active spaces) by default; archived lists the archived spaces and trash the deleted spaces that the reader administers (owner, 23 Nov 2026). |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of spaces. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Create a tenant or team space with its default grants and its home page

`POST /doc-spaces`

- Operation ID: `createDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `DocSpaceCreateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Move a tenant or team space and all its pages to the trash, exactly as previewed

`DELETE /doc-spaces/{spaceId}`

- Operation ID: `deleteDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `pageCount` | query | integer | yes |  |
| `clientVisibleCount` | query | integer | no | 0 for a company or team space (no client-visible page in this form). |
| `publicCount` | query | integer | no | 0 for a company or team space (no public page in this form). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The space and its pages are in the trash. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One space with its settings, counts and the reader's possible actions

`GET /doc-spaces/{spaceId}`

- Operation ID: `getDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The space. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Change a space's key, name, description, home page or default template (the access settings are setDocSpaceAccessSettings)

`PATCH /doc-spaces/{spaceId}`

- Operation ID: `updateDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/merge-patch+json, required): `DocSpacePatch`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Change the space settings that decide who sees what — the default audience, the reader source and client comments

`PUT /doc-spaces/{spaceId}/access-settings`

- Operation ID: `setDocSpaceAccessSettings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocSpaceAccessSettingsRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The space's recent changes for the pages the reader can read

`GET /doc-spaces/{spaceId}/activity`

- Operation ID: `listDocSpaceActivity`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-19

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `kind` | query | string | no |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of activity rows. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The pending agent changes of a space for the members who can apply them

`GET /doc-spaces/{spaceId}/agent-changes`

- Operation ID: `listDocAgentChanges`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-24

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `state` | query | string | no |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of agent changes. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Make a space read-only

`POST /doc-spaces/{spaceId}/archive`

- Operation ID: `archiveDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The archived space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The projects whose portals a tenant or team space is linked to, with each link's state

`GET /doc-spaces/{spaceId}/client-links`

- Operation ID: `listDocSpaceClientLinks`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-20

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The links. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Remove a space's link to a project's portal

`DELETE /doc-spaces/{spaceId}/client-links/{projectKey}`

- Operation ID: `unlinkDocSpaceFromProject`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-20

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The link is removed. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Link (or re-link) a tenant or team space to a project's portal for the confirmed client version

`PUT /doc-spaces/{spaceId}/client-links/{projectKey}`

- Operation ID: `linkDocSpaceToProject`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-20

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `DocClientLinkRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The current link. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## What linking the space to the project's portal would show to the client

`GET /doc-spaces/{spaceId}/client-links/{projectKey}/consequence`

- Operation ID: `getDocClientLinkConsequence`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-20

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The consequence and the client version to confirm. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## What a delete of the space would hide, with the restore deadline and any blocker

`GET /doc-spaces/{spaceId}/deletion-preview`

- Operation ID: `previewDocSpaceDeletion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The preview. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Export the pages of a space that the requester can read as a ZIP of Markdown files

`POST /doc-spaces/{spaceId}/exports`

- Operation ID: `exportDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-25

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The export operation. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Stop the space's Git sync (the repository's files stay)

`DELETE /doc-spaces/{spaceId}/git-sync`

- Operation ID: `disconnectDocGitSync`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The sync is disconnected. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The space's Git sync and its status

`GET /doc-spaces/{spaceId}/git-sync`

- Operation ID: `getDocGitSync`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The sync. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Create or change the space's Git sync (branch, folder, direction, content)

`PUT /doc-spaces/{spaceId}/git-sync`

- Operation ID: `configureDocGitSync`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocGitSyncRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The sync; an initial or reconcile run is queued. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The pages that changed in Git and in Youniton since the last sync

`GET /doc-spaces/{spaceId}/git-sync/conflicts`

- Operation ID: `listDocGitConflicts`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of conflicts (without the Git body; read one page's conflict for it). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The sync's runs, newest first, for 90 days

`GET /doc-spaces/{spaceId}/git-sync/runs`

- Operation ID: `listDocGitRuns`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of runs. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Start a reconcile run now

`POST /doc-spaces/{spaceId}/git-sync/runs`

- Operation ID: `requestDocGitRun`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The queued run. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The grants of a tenant or team space with the principals' current names

`GET /doc-spaces/{spaceId}/grants`

- Operation ID: `getDocSpaceGrants`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-12

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The grants and the version to send back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Replace the grants of a tenant or team space

`PUT /doc-spaces/{spaceId}/grants`

- Operation ID: `replaceDocSpaceGrants`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-12

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocSpaceGrantsRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The new grants. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Every page of a space the reader can read, in tree order, 200 per page

`GET /doc-spaces/{spaceId}/page-index`

- Operation ID: `listDocSpacePageIndex`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of the index. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One level of a space's tree (the top level, or one parent's children)

`GET /doc-spaces/{spaceId}/pages`

- Operation ID: `listDocSpaceTreeLevel`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `parentId` | query | string (uuid) | no |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The level. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Create a page or a section in a space, at any allowed depth, from a template or empty

`POST /doc-spaces/{spaceId}/pages`

- Operation ID: `createDocSpacePage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

Request body (application/json, required): `DocSpacePageCreateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new page. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The pages of the space that carry the public flag

`GET /doc-spaces/{spaceId}/public-pages`

- Operation ID: `listDocPublicPages`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of public pages. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set or clear the public flag of up to 200 named pages

`POST /doc-spaces/{spaceId}/public-pages`

- Operation ID: `setDocPagesPublic`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

Request body (application/json, required): `DocPublicBulkRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The counts of changed and unchanged pages. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The space's public site, its status, address and domain

`GET /doc-spaces/{spaceId}/public-site`

- Operation ID: `getDocPublicSite`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The site. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Create or change the space's public site configuration (draft until published)

`PUT /doc-spaces/{spaceId}/public-site`

- Operation ID: `configureDocPublicSite`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocPublicSiteRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The site. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Remove the site's custom domain

`DELETE /doc-spaces/{spaceId}/public-site/domain`

- Operation ID: `removeDocSiteDomain`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The domain is removed. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Add or replace the site's custom domain (pending until verified)

`PUT /doc-spaces/{spaceId}/public-site/domain`

- Operation ID: `setDocSiteDomain`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

Request body (application/json, required): `DocSiteDomainRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The domain with the DNS records to create. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Check the domain's DNS records now

`POST /doc-spaces/{spaceId}/public-site/domain/verify`

- Operation ID: `verifyDocSiteDomain`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The domain's state after the check. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Put the public site on the internet

`POST /doc-spaces/{spaceId}/public-site/publish`

- Operation ID: `publishDocPublicSite`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The published site. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Take the public site off the internet

`POST /doc-spaces/{spaceId}/public-site/unpublish`

- Operation ID: `unpublishDocPublicSite`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-21

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The unpublished site. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Publish up to 50 pages of a space at once, each by its exact version and digest — all or none

`POST /doc-spaces/{spaceId}/publish-batch`

- Operation ID: `publishDocPageBatch`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-19

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

Request body (application/json, required): `DocPublishBatchRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | One new revision per page. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The channel of a company or team space's doc_space.changed (realtime, owner 23 Nov 2026)

`GET /doc-spaces/{spaceId}/realtime`

- Operation ID: `getDocSpaceRealtimeChannel`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

`private-tenant.{t}.doc-space.{s}.v{n}.m{audience}` — `n` is the audience epoch: it moves when a membership, a role or a sign-in of the tenant narrows. The audience is a team space's member fingerprint or `all` for a company space, so a removal from the team renames it. Opened as the space's read: another team's space, a client and an unknown id answer 404. The SPA joins it while the space is on screen and reads the tree, the trash and the open page again on `doc_space.changed`, and the name again on `channels.rotated`.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The channel to join. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Connect the chosen repository to the space with a consumed token check

`POST /doc-spaces/{spaceId}/repository-connections`

- Operation ID: `connectDocSpaceRepository`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | Connected; a manual hook's URL and secret are returned once. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 502 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Verify a pasted token for a space's Git sync (write access) and list the repositories it can write

`POST /doc-spaces/{spaceId}/repository-token-checks`

- Operation ID: `checkDocSpaceRepositoryToken`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The verified token's facts and repositories; never the token. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 502 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Restore a deleted space with the pages of its delete batch

`POST /doc-spaces/{spaceId}/restore`

- Operation ID: `restoreDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The restored space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Empty trash of a company or team space — every trashed page of the space deleted forever (space admins; at most 500 per call)

`DELETE /doc-spaces/{spaceId}/trash`

- Operation ID: `emptyDocSpaceTrash`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

As built (owner #45 and owner Q18; DocSpaceController::emptyTrash, PurgeDocTrashHandler): the space's `administer` (a tenant admin outside the team is audited, owner Q10); an archived space's trash is read-only (F-DOC-11.R10). Per page exactly what docs:purge-trash does, as F-DOC-05's emptyDocTrash; each page is audited doc.deleted_forever. hasMore true asks for another call.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The pages deleted forever and whether the trash holds more. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The trashed pages of a space that the reader may see, newest first, with their restore deadline

`GET /doc-spaces/{spaceId}/trash`

- Operation ID: `listDocSpaceTrash`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of trashed pages; a page that the reader could not read when it was trashed is left out without a count. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Delete forever one trashed page of a company or team space with its trashed subpages (space admins)

`DELETE /doc-spaces/{spaceId}/trash/{pageId}`

- Operation ID: `purgeDocSpaceTrashPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

As built (owner #45 and owner Q18; DocSpaceController::purge, PurgeDocTrashHandler): the space's `administer`; a page that is not in this space's trash answers 404 doc_page.not_found; an archived space's trash is read-only (F-DOC-11.R10). The evidence guard of docs:purge-trash applies; each page is audited doc.deleted_forever.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The pages deleted forever (the page and its trashed subpages). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Make an archived space writable again

`POST /doc-spaces/{spaceId}/unarchive`

- Operation ID: `unarchiveDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The active space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The space's pages whose latest version is not published

`GET /doc-spaces/{spaceId}/unpublished-changes`

- Operation ID: `listDocUnpublishedChanges`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-19

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of pages with unpublished changes. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Stop watching a space

`DELETE /doc-spaces/{spaceId}/watch`

- Operation ID: `unwatchDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

The caller stops watching the space; idempotent by state. The refusals are the ones of watchDocSpace.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The watch state. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Watch every page of a space

`PUT /doc-spaces/{spaceId}/watch`

- Operation ID: `watchDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-15

The caller (an internal member who can read the space) starts to watch every page of it; idempotent by state. Until F-DOC-11 the space is the project's own space: spaceId is the project id (getProjectDocSpace answers it as id), and a project outside the caller's scope, of another tenant or unknown answers 404 project.not_found, as getProjectDocSpace does; the Docs module off answers 403 feature.unavailable, a preview 403 preview.read_only.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The watch state (page is false). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The progress of a large move, restriction, client-setting change, copy or restore — its starter and the project admins of its root only, as a percentage

`GET /doc-subtree-jobs/{jobId}`

- Operation ID: `getDocSubtreeJob`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `jobId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The job. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The templates offered for one space — the space's, the tenant's and the built-in ones

`GET /doc-templates`

- Operation ID: `listDocTemplates`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-14

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | query | string (uuid) | yes |  |
| `category` | query | string | no |  |
| `includeArchived` | query | boolean | no | Template managers only; archived templates are listed after the live ones. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of templates. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Save a page as a space or tenant template, or replace a template's body from a page (owner Q15)

`POST /doc-templates`

- Operation ID: `createDocTemplate`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-14

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `If-Match` | header | string | no | As built (owner Q15, 24 November 2026; DocTemplateController::create, IfMatch::optional): "Replace <name>" (`replaceId`) sends the template's version in quotes. A different version answers 412 stale-version, and nothing changes; a replace without it answers 422 (`/expectedVersion`). "Save as template" sends none. |

Request body (application/json, required): `DocTemplateCreateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | As built (owner Q15, 24 November 2026; DocTemplateController::create): the template's id and its current version — 1 for a new template, the next version for a replace. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The built-in templates with their "Offered" switch — the registry key docs.templates.builtins (owner Q15; a tenant admin)

`GET /doc-templates/builtins`

- Operation ID: `listDocBuiltinTemplates`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-14

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Every built-in; Blank page is locked on. `meta.version` is the `If-Match` of a change. | application/json | `DocBuiltinTemplateSwitches` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set the built-ins that New page offers (Blank page is always kept)

`PUT /doc-templates/builtins`

- Operation ID: `changeDocBuiltinTemplates`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-14

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The switches after the change. | application/json | `DocBuiltinTemplateSwitches` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The saved templates a manager sees — every live template for a tenant admin, or one space's for its admin (owner Q15)

`GET /doc-templates/managed`

- Operation ID: `listManagedDocTemplates`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-14

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `spaceId` | query | string (uuid) | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The live saved templates, by name. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Rename, describe, recategorise, archive or unarchive a template

`PATCH /doc-templates/{templateId}`

- Operation ID: `updateDocTemplate`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-14

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `templateId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/merge-patch+json, required): `DocTemplatePatch`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | As built (owner Q15, 24 November 2026; DocTemplateController::update): `{name}` renamed the template; its id and current version. | application/json | `object` |
| 204 | As built (owner Q15, 24 November 2026): `{deleted: true}` deleted the template for good; no body. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The trashed pages of the active company and team spaces whose trash the reader may read, newest first

`GET /doc-trash`

- Operation ID: `listDocTenantTrash`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-13

The Documents home's Trash tab (owner, 24 Nov 2026; register §230 add. 99). A space adds rows only when the reader passes the two checks of listDocSpaceTrash (view and edit_docs on the space). The answer has no total. Restore and purge use the operations of the row's space.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of trashed pages with their spaces. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Usage per space for Admins — pages, versions, attachment bytes, comments, public pages

`GET /doc-usage`

- Operation ID: `listDocSpaceUsage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-25

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of usage rows. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Create a page or section at the end of the top level or of a parent

`POST /projects/{projectKey}/doc-pages`

- Operation ID: `createDocPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-02

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `projectKey` | path | string | yes |  |

Request body (application/json, required): `DocPageCreateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The created page, untagged and without a version. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## XM-989 — Empty trash, deleting every trashed node of the project forever (project Admins; at most 500 per call)

`DELETE /projects/{projectKey}/doc-pages/trash`

- Operation ID: `emptyDocTrash`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

Owner Q18 (22 Nov 2026). Needs administer on an active project. Per page exactly what docs:purge-trash does — the evidence guard, then the deletes or the evidence tombstone, children first. Each page is audited doc.deleted_forever. hasMore true asks for another call.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The pages deleted forever and whether the trash holds more. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's trashed nodes, newest first, with their restore deadline

`GET /projects/{projectKey}/doc-pages/trash`

- Operation ID: `listDocTrash`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of trashed nodes. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## XM-989 — Delete forever one trashed node with its trashed subpages of its delete batch (project Admins)

`DELETE /projects/{projectKey}/doc-pages/trash/{pageId}`

- Operation ID: `purgeDocTrashPage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-05

Owner Q18 (22 Nov 2026). Needs administer on an active project; a page that is not in this project's trash answers 404 doc_page.not_found. The evidence guard of docs:purge-trash applies; each page is audited doc.deleted_forever.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes |  |
| `pageId` | path | string (uuid) | yes | A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The pages deleted forever (the node and its trashed subpages). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project space of one project

`GET /projects/{projectKey}/doc-space`

- Operation ID: `getProjectDocSpace`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The project space. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The tenant and team spaces that the project's AI chat also reads

`GET /projects/{projectKey}/related-doc-spaces`

- Operation ID: `getProjectRelatedDocSpaces`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-23

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The related spaces the reader can read. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Replace the project's related spaces (at most 10)

`PUT /projects/{projectKey}/related-doc-spaces`

- Operation ID: `setProjectRelatedDocSpaces`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-23

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `DocRelatedSpacesRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The related spaces. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
