update_page
Validate edited page sources, preview changes with a dry run, and save updates only when confirmed. Prevents overwriting concurrent edits by checking versions before commit.
Instructions
Overwrites an EXISTING page's source with an edited tree (source-only; re-render in the editor for preview/publish). Validates first. DEFAULTS to dry_run=true (validates, caches the source as draft_id, previews the request, token masked); dry_run=false to actually save. Accepts draft_id from a previous call (dry_run, or a timed-out/failed update) — re-runs from the cached source without re-sending the full JSON. Needs WEBCAKE_API_BASE + WEBCAKE_JWT.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Default false. true = save even when the page changed outside this session, discarding those changes. Only pass it after the user has said to. | |
| source | No | The edited page source { page, popup, settings, options, cartConfigs } (object or JSON string). Required unless draft_id is given. The compacted tree from get_page can be edited and sent back AS-IS — sparse nodes are re-hydrated from factory defaults (a full tree also works). | |
| dry_run | No | Default TRUE — validate, cache the source as draft_id, and preview without sending. Set false to actually save. | |
| page_id | No | The page id to update (must be owned by the account). Required unless draft_id is given (the page_id is stored in the draft). | |
| draft_id | No | A draft_id from a previous update_page call (dry_run=true or a timed-out/failed update). Loads the cached source — no need to re-send the full JSON. Use for dry-run → real call transitions and retrying after a timeout. | |
| base_version | No | The source_version get_page returned for this page. When it no longer matches the live page the save is REJECTED instead of reverting whatever was edited in the Webcake editor meanwhile. Optional — omit it and the server uses the version it recorded on your last read/write of this page. |