Update a page
update_pageUpdate a wiki page by replacing its body or applying exact find-and-replace edits; it detects concurrent changes and refuses to overwrite unless forced.
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.
That refusal is a normal result and not an error: it explains what to do — read the page again with get_page, redo the change on top of what is now there, and write. Note that render_page also bumps the page’s timestamp, so calling it between your read and your write triggers the same refusal even though nobody else touched anything.
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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| truncated | No | Present only when the answer was shortened to fit the budget. |