Prerequisites
- An API key with any access role — see Create an API key
- A website with a draft change — see Edit source code
Preview hosts
Each website has a readable platform subdomain label, for exampleember-oak or ember-oak-k7m4p2 when a uniqueness suffix is needed. Three host shapes hang off it:
Use the draft host for review; use version restore (below) when you need to see an older version today.
The site studio displays the draft directly in its Preview tab. You can switch device sizes, choose a static page, enter another path, refresh the draft, or open it in a new tab. The loaded preview stays in place when you move between studio tabs, then refreshes when the draft revision changes or you choose Refresh. A separate live-site action appears after the site is published.
Navigation inside the preview keeps the studio address in sync, including query strings and anchors. While the agent edits, both the studio preview and standalone draft links keep the current page visible until the updated preview is loaded, then restore your scroll position. Standalone draft links keep their address bar and browser Back and Forward navigation synchronized with the displayed page. Queued element selections survive these updates. Older browsers without the Navigation API use normal page reloads. A full preview update loads a new document, so unsent form input and other page-local state may reset.
When the current head has no ready deployment, the studio starts the draft build and shows its progress. Once any build has succeeded, the draft keeps serving the last good build while newer builds run or fail; a status pill in the corner reports progress and swaps the new build in automatically. A failed build never affects the live site.
1
Find your platform subdomain
List the website’s domains and take the The draft host is the same hostname with a
platform_subdomain hostname:Find the label
Response (truncated)
draft-- prefix on the label: draft--ember-oak-k7m4p2.cactal.app.2
Open the draft preview
Open
https://draft--<label>.cactal.app in a browser. It renders the head version — every saved source change, published or not.Draft previews rebuild automatically after each source write. Once a build has succeeded, the host keeps serving the last good build during rebuilds: a corner pill shows “Updating preview” and the page swaps in the new build on its own. If the head fails to build, the last good build keeps serving and the pill exposes the build error. Before the first successful build, the host returns a 202 “Building your preview” page that updates itself. Transient build infrastructure failures retry automatically; source errors need a source fix (the error is available on the page and via POST /v1/websiteSourceCode/deployment/status).Two behaviors to know:- The draft host previews draft source code, not draft content: CMS reads on it return published items only. Review draft items over the API with
published=false, or in the dashboard. - The draft host never redirects to your primary custom domain; only production hosts do.
3
Share the preview with clients
The draft URL is a plain public URL — reviewers need no Cactal account or login. Send
https://draft--<label>.cactal.app/pricing to put a client on the exact page under review.Search engines are excluded twice over: every preview response carries X-Robots-Tag: noindex, nofollow, and the preview’s /robots.txt serves Disallow: /.Anyone with the URL can view the draft. Do not stage confidential content on a website whose draft URL has been shared.
4
Preview an older version
Version hosts (This creates a new head version with version 7’s files — history is append-only, so nothing is lost. The draft host now shows version 7’s content. See Roll back and recover for the full recovery toolkit, including how to return to where you were.
v<n>--<label>) are reserved and not yet served. To review an older version now, restore it to head and use the draft host:Restore version 7 to head
5
Verify preview behavior
Confirm the draft host is live and marked non-indexable:
Inspect preview headers
You should see
HTTP/2 200 and x-robots-tag: noindex, nofollow. The production host (<label>.cactal.app) returns no such header.Capture a screenshot
Opening the draft host in a browser is the fastest review, but agents and scripts often have no browser.POST /v1/websitePreview/capture renders one page in a real browser and returns the image, so layout, spacing, and responsive behavior can be checked without one. Over MCP the image comes back as an image block the model can actually look at.
Capture the pricing page on mobile
path is site-relative and may carry a query string, so dynamic routes are captured with real values rather than placeholders. target selects head (default) or published. viewport is desktop (1440x900), tablet (834x1112), or mobile (390x844).
To control framing and timing:
Fonts, images, and — for
fullPage — lazily loaded content are awaited before every capture, so the extra waits are only needed for content that arrives on its own schedule.
Focus on one region
A viewport or full-page capture often shows far more than the question needs. To look at one component, passselector and, when the surrounding context matters, padding:
Capture the pricing table with 24px of context on mobile
clip only for a region no element frames, such as part of a canvas or chart or a band spanning several elements. Clip coordinates are CSS pixels from the top-left of the page, measured at the chosen viewport.
A focused region is scrolled into view and captured from the configured viewport, exactly as a visitor would see it, so it must fit within that viewport. A region that is larger than the viewport, a clip that lies outside the page, a selector that matches nothing visible, or an ambiguous combination fails with 400 and a message naming the problem; page through larger regions with scrollTo or capture fullPage instead. selector and clip exclude each other and fullPage.
Color-scheme captures reserve the __cactal query parameter to isolate renderer caches. Cactal removes it before route data and site scripts run, so it never becomes part of the page’s application state.
A head capture requires a ready draft build. While the build is running the endpoint returns 409 rather than a screenshot of an interim state; poll POST /v1/websiteSourceCode/deployment/status with target: "head" until the deployment is ready, then capture again.
How previews relate to publishing
The draft host tracksheadVersion; production hosts track publishedVersion. Publishing (POST /v1/websiteSourceCode/head/publish) promotes the checked head to published — at that moment the production host changes and the two hosts converge. Until then, edits affect only the draft host. GET /v1/websiteSourceCode/summary reports both versions and hasUnpublishedChanges.
Troubleshooting
Next steps
- Roll back and recover to act on what you find in review
- Publishing concepts for the check → publish → serve pipeline