Replace a page with new HTML
replace_page_htmlRe-imports ONE page (the home page too) from new HTML, in place: same address, same share link, same place in the page order, and a version is saved first so it can be undone. Use it to refresh a page built earlier. stage:true previews it before it goes live. Free.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"html": "<html>"
},
"name": "replace_page_html"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The new full HTML for this page, imported exactly like create_site_from_html (the result includes the import report). The page keeps its address, its place in the page order and its version history; a version is saved first. | |
| path | No | The page to replace, e.g. "/about". "/" (the home page) is allowed. Defaults to "/". | |
| stage | No | true = replace a staged copy instead of the live page: preview it at staged_preview_url, then publish_staged or discard_staged. Required with the operator token on a live site. | |
| site_key | No | The site the page belongs to. Defaults to the caller's current draft site when omitted. | |
| draft_token | No | The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header. | |
| keep_added_sections | No | true = keep the sections added with add_section (reviews, map and the like) after the imported content, in their original order. Default false: the page is replaced and the result lists them in dropped_sections with a warning (an empty list means none were dropped). |