Update a page
update_pageModify wiki page content or metadata with full-body replacement or precise text edits. It prevents accidental overwrites by detecting concurrent changes and rejects ambiguous matches.
Instructions
Changes a page. Pass content to replace the whole body, or edits for surgical find-and-replace — each edit’s old_text must appear exactly once, and an ambiguous or missing match is refused rather than applied to the wrong place. Before writing, this checks whether somebody else changed the page since it was read and refuses to clobber them; pass force=true to overwrite deliberately. Metadata fields can be changed on their own, without touching the text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Page path without a leading slash and without the locale prefix, e.g. "docs/setup". A browser URL looks like /en/docs/setup — drop the "en/", it is the locale argument. (Not enforced: "ci/", "db/" and "qa/" are perfectly good first segments that happen to look like locale codes.) | |
| tags | No | Replaces the whole tag list, it is not merged. | |
| edits | No | Find-and-replace edits. Mutually exclusive with content. | |
| force | No | Write even though the page changed since you read it. Overwrites the other person’s edit. | |
| title | No | Page title as shown in the wiki. | |
| editor | No | Storage format. "markdown" for markdown source, "ckeditor" for rich-text HTML, "code" for raw HTML, "asciidoc" for AsciiDoc. | |
| locale | No | Locale code. Defaults to WIKIJS_LOCALE. The locale is part of a page’s identity. | |
| content | No | Replacement body. Mutually exclusive with edits. | |
| page_id | No | Numeric Wiki.js id. | |
| is_private | No | ||
| description | No | Short page description, shown in listings and search results. | |
| is_published | No | ||
| expected_updated_at | No | The updatedAt value you saw when you read this page. Normally unnecessary — a previous get_page in this session is remembered automatically — but it makes the concurrent-edit check work without one. |