update-page
Update an existing wiki page's content, with support for edit-conflict detection, section editing, and append or prepend modes. Returns the new revision ID.
Instructions
Replaces the existing content of a wiki page and returns the new revision ID. Fails if the page does not exist; for new pages, use create-page. Pass latestId (obtained from get-page with metadata=true) to enable edit-conflict detection: if the page has been edited since that revision, the update is rejected rather than silently clobbering concurrent changes. For large pages, three modifiers avoid shipping the full source: section=N edits one section (pairs with get-page section=N for reads), section='new' adds a new heading section, and mode='append' or 'prepend' sends a delta. Each call is a separate revision; for chains of mode='append' calls, re-fetching latestId between calls confirms the previous chunk landed before the next.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Wiki page title | |
| source | Yes | The content to write, in the existing page's content model. Interpreted as the full page by default; as the given section's content when section is set; or as a delta (appended or prepended) when mode is set. | |
| latestId | No | Base revision ID for edit-conflict detection; obtain from get-page with metadata=true. If omitted, the update is applied without conflict detection. | |
| comment | No | Summary of the edit | |
| section | No | Section to edit: 0 (lead), 1..N (existing heading sections), or 'new' to append a new heading section. | |
| mode | No | Adds source to the existing content instead of replacing it: 'append' to the end, 'prepend' to the start. | |
| sectionTitle | No | Heading for a new section; required when section='new', rejected otherwise. |