Documents
Workspace doc pages (Notion-style).
10 actions. Each is callable by the agent as a tool, over HTTP via /api/invoke, and (usually) from a UI page.
documents.list
GET
List documents (Notion-style wiki pages). Optionally filter by project or parent page. Returns metadata + markdown content.
- AI tool:
documents_list - API:
GET /api/invoke/documents.list
Input
| Field | Type | Required | Description |
|---|---|---|---|
projectId |
string | — | |
parentId |
string | — | |
limit |
integer | — | |
offset |
integer | — | |
orderBy |
string | — | |
orderDir |
"asc" | "desc" | — | |
q |
string | — |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"projectId": {
"type": "string",
"minLength": 1
},
"parentId": {
"type": "string",
"minLength": 1
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 500
},
"offset": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"orderBy": {
"type": "string"
},
"orderDir": {
"type": "string",
"enum": [
"asc",
"desc"
]
},
"q": {
"type": "string"
}
}
}documents.get
GET
Fetch one document/page by id, including its full markdown content.
- AI tool:
documents_get - API:
GET /api/invoke/documents.get
Input
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
}
},
"required": [
"id"
]
}documents.create
POST · mutating
Create a document/page (or a 'folder' to organize the sidebar tree — set kind:'folder'). Content is markdown. Optionally nest under a parent (parentId) or attach to a project (projectId).
- AI tool:
documents_create - API:
POST /api/invoke/documents.create
Input
| Field | Type | Required | Description |
|---|---|---|---|
title |
string | — | |
icon |
union | — | |
content |
string | — | |
parentId |
union | — | |
projectId |
union | — | |
kind |
"doc" | "folder" | — |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"title": {
"type": "string"
},
"icon": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"content": {
"type": "string"
},
"parentId": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"projectId": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"kind": {
"type": "string",
"enum": [
"doc",
"folder"
]
}
}
}documents.update
PATCH · mutating
Update a document — title, icon, markdown content, parent, project, or order.
- AI tool:
documents_update - API:
PATCH /api/invoke/documents.update
Input
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
patch |
object | yes |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"patch": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"icon": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"content": {
"type": "string"
},
"parentId": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"projectId": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"position": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
}
}
},
"required": [
"id",
"patch"
]
}documents.delete
DELETE · mutating
Soft-delete a document. Its child pages are re-parented to root so they are not lost.
- AI tool:
documents_delete - API:
DELETE /api/invoke/documents.delete
Input
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
}
},
"required": [
"id"
]
}documents.search
GET
Search documents by title/content. Use this to find a page before reading or editing it.
- AI tool:
documents_search - API:
GET /api/invoke/documents.search
Input
| Field | Type | Required | Description |
|---|---|---|---|
q |
string | yes | |
limit |
integer | — |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"q": {
"type": "string"
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 50
}
},
"required": [
"q"
]
}documents.versions.list
GET
List a document's published version history (newest first). Each entry is an immutable snapshot.
- AI tool:
documents_versions_list - API:
GET /api/invoke/documents.versions.list
Input
| Field | Type | Required | Description |
|---|---|---|---|
documentId |
string | yes |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
}
},
"required": [
"documentId"
]
}documents.versions.get
GET
Fetch one document version (with full markdown content) — e.g. to diff or preview before restoring.
- AI tool:
documents_versions_get - API:
GET /api/invoke/documents.versions.get
Input
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
}
},
"required": [
"id"
]
}documents.versions.publish
POST · mutating
Publish the document's current state as a new recoverable version. Optionally label it.
- AI tool:
documents_versions_publish - API:
POST /api/invoke/documents.versions.publish
Input
| Field | Type | Required | Description |
|---|---|---|---|
documentId |
string | yes | |
label |
union | — |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"documentId"
]
}documents.versions.restore
POST · mutating
Restore a document to a past version. The current state is auto-snapshotted first, so restoring is reversible.
- AI tool:
documents_versions_restore - API:
POST /api/invoke/documents.versions.restore
Input
| Field | Type | Required | Description |
|---|---|---|---|
documentId |
string | yes | |
versionId |
string | yes |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
},
"versionId": {
"type": "string",
"minLength": 1
}
},
"required": [
"documentId",
"versionId"
]
}