Update page
update_pageUpdate a page's metadata: rename its slug, change its title, toggle reorder (sort_order), or merge into its metadata. For a page's search title, description, share image or noindex, use update_seo with page_slug. At least one field must be passed. The page tree itself is NOT touched — use insert_nodes / patch_nodes for tree edits. To change the nav, edit the nav-link nodes directly (insert_nodes / patch_nodes / remove_nodes).
Renames: the home page ('/') cannot be renamed (it'd break routing). new_slug must satisfy /^/[a-z0-9/-]*$/, not collide with any existing page, and not shadow a reserved Sitelas route (edit). By default, every node whose data.href / data.url equals the old slug is rewritten to the new slug in the same draft write — so internal links stay valid after the rename. The response reports the count and the rewritten node ids. Pass rewrite_links: false to skip the auto-rewrite (only useful when the caller intends to surgically patch the hrefs themselves). Sub-pages move with the parent by default — pass cascade: false to leave them behind — and every moved URL 308-redirects from its old path once published, so existing links and search results survive. Reach for this whenever a page's slug no longer matches what the page became: adapting a template to a different line of work renames the visible labels but leaves the paths saying the old thing. Writes a new draft version; call publish to push live.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | Current slug of the page to update (must exist). Use '/' for the home page. | |
| title | No | ||
| cascade | No | On rename, also move sub-pages — pages whose slug starts with `${slug}/` — onto the new prefix, at any nesting depth (`/work/a/b` under a `/work` → `/studio` rename becomes `/studio/a/b`). Default true, because the page tree IS the slug prefix: moving a parent without its children leaves them under a path that no longer exists. Set false only when you intend to re-home the children yourself. Each moved page gets its own old-URL redirect and inbound-link rewrite. | |
| site_id | Yes | ||
| metadata | No | Merged into the page's stored metadata, key by key; `null` removes a key. For the page's search title, description, share image or noindex use `update_seo` with `page_slug` instead. `renamed_from` (the old URLs that redirect here) is kept by the platform and cannot be set or removed. | |
| new_slug | No | Rename the page to this slug. Must match /^\/[a-z0-9/-]*$/ and not collide with an existing page or reserved route. Internal links pointing at the old slug ARE rewritten automatically (see `rewrite_links`, default true), and sub-pages move with the parent (see `cascade`, default true), all in the same atomic write — so renaming is safe and needs no patch_nodes follow-up. The old URL keeps working: it 308-redirects to the new one once published. The response reports how many links were rewritten and which sub-pages moved. | |
| sort_order | No | Re-order the page in the site's page list and sitemap output. Lower numbers come first; home (`/`) is conventionally 0. This does NOT change the site's menu — nav links are nodes placed in the header. | |
| rewrite_links | No | On rename, automatically rewrite every node's `data.href` / `data.url` that equaled the old slug to the new slug. Default true — keeps internal links working after the rename. Set false to leave inbound hrefs untouched (the response still reports the count, so the caller can rewrite them manually with patch_nodes). |