v44

latestSwagger 2.0raw.githubusercontent.com2026-08-01304236810.6 KB
Wiki

Update a wiki page

Partially update a wiki page by slug. Absent fields keep their stored value. When version is > 0 it acts as an optimistic-lock guard: a mismatch with the stored version returns 409 together with the current version so the client can reload and re-apply.

put/knowledgebase/{kb_id}/wiki/pages/{slug}

Path parameters

kb_idstring required

Knowledge base ID

slugstring required

Page slug

Request body

aliasesstring[]
contentstring
page_typestring
statusstring
summarystring
titlestring
versioninteger

Version is the optimistic-lock guard: when > 0 the update is rejected with a conflict if the stored version differs (someone else edited the page since the client loaded it). 0 skips the check (legacy clients).

Response

OK

aliasesstring[]

Alternate names, abbreviations, acronyms or translated names

category_pathstring[]

CategoryPath is the directory breadcrumb that groups this page in the wiki browser, e.g. ["AI", "LLM 应用", "RAG"]. Derived cache of the folder chain identified by FolderID.

chunk_refsstring[]

ChunkRefs records the specific source-document chunks this page was built from — one UUID per cited chunk. Populated during ingest from the chunk-citation pass; refreshed wholesale whenever the page is re-materialized. Empty for summary pages (they are document-level synopses and don't carry chunk-level citations). Use this when you need to surface the underlying evidence for a wiki page, or to retract citations when a source document is deleted.

contentstring

Full markdown content

created_atstring

Creation time

depthinteger

Depth is len(CategoryPath), cached for filtering / display.

folder_idstring

FolderID is the single source of truth for where this page sits in the directory tree — a reference to wiki_folders.id ("" = wiki root). The CategoryPath / WikiPath / Depth fields below are denormalized caches recomputed from this folder's chain on every write so list/index/search queries don't have to join wiki_folders.

idstring

Unique identifier (UUID)

in_linksstring[]

Slugs of pages that link TO this page (backlinks)

knowledge_base_idstring

Knowledge base this page belongs to

last_edit_sourcestring

LastEditSource records who authored the CURRENT version: pipeline | agent | user | revert. Empty for legacy rows (treated as pipeline). When the version is superseded this value travels into the revision snapshot, so each historical version keeps its own author kind.

last_editor_idstring

LastEditorID is the user id of the caller that produced the current version (empty for background pipeline writes).

out_linksstring[]

Slugs of pages this page links to (outbound links)

page_metadatainteger[]

Arbitrary metadata (tags, categories, dates, etc.)

page_typestring

Page type: summary, entity, concept, index, synthesis, comparison

parent_slugstring

ParentSlug optionally points at the wiki page that should act as this page's semantic parent in the directory tree. The parent may be empty when the page is grouped only by FolderID.

slugstring

URL-friendly slug for addressing, e.g. "entity/acme-corp", "concept/rag" Unique within a knowledge base

sort_orderinteger

SortOrder allows generated or manually edited pages to control sibling ordering before falling back to title.

source_refsstring[]

References to source knowledge IDs that contributed to this page. Format matches the legacy "<knowledge_id>|<doc_title>" convention used across the ingest pipeline, so retract / display code can split on | to recover the title. Document-level granularity.

statusstring

Page status: draft, published, archived

summarystring

One-line summary for index listing

tenant_idinteger

Workspace ID for multi-workspace isolation

titlestring

Human-readable title

updated_atstring

Last update time

versioninteger

Version number. Incremented only when a user-visible content field (title, content, summary, page_type, status) actually changes; pure bookkeeping writes (link maintenance, same-content re-ingest, status sync from background jobs) leave it untouched so it can be used as a real "the page was edited" signal.

wiki_pathstring

WikiPath is a normalized, sortable path derived from page_type, category_path, and title. It keeps large directory listings cheap to sort.