publish_page
Publishes an existing page to a custom domain or preview URL, with optional dry run to test without making it live.
Instructions
Publishes an EXISTING page LIVE via the editor's publish_html route: builds the rendered app on the Webcake build host (POST /render/build; prod default https://build.webcake.io, override with WEBCAKE_BUILD_BASE env / x-webcake-build-base header), then creates/updates the PagePublishedV2 record — the record ALL public serving reads. With custom_domain the page goes live at that domain (it must already point at Webcake); OMIT custom_domain to reuse the page's currently-attached domain (mirrors the editor's publish modal — republishing keeps the page live at the same URL), falling back to a find_pages lookup by id. WITHOUT any domain (the page has none, or you pass custom_domain='') there is NO permanent public URL: the returned preview link (/preview/) only renders for ~10 minutes after the publish, then shows 'Preview page is expired' — tell the user to attach a domain for a lasting URL. If no build host is configured or the build fails, falls back to the LEGACY source-only publish route with a warning (saves a version; nothing goes live; the page stays blank). DEFAULTS to dry_run=true (network-free: does NOT call the build host on dry_run). Needs WEBCAKE_API_BASE + WEBCAKE_JWT.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Default TRUE — preview the request without sending. Does NOT call the build host. Set false to actually publish (build + publish). | |
| page_id | Yes | The page id to publish (must be owned by the account). | |
| custom_path | No | Optional path under the custom domain (e.g. 'sale'). | |
| custom_domain | No | Optional custom domain to serve the page at (e.g. 'shop.example.com' — must already point at Webcake). OMIT to reuse the page's CURRENTLY-ATTACHED domain (so republishing keeps it live at the same URL, like the editor's publish modal); if the page has none it publishes domain-less (preview-host URL). Pass an empty string '' to force a domain-less publish even when the page has a domain. |