Prerequisites
- A Cactal account — sign up at app.cactal.ai.
- An API key exported as
CACTAL_API_KEY— see Create an API key.
1
Find your organization id
Every website belongs to an organization. List the organizations your key can access:The response is an array. Copy the
List organizations
id you want to create the website in:Response
2
Create a website
Create a website
headVersion is the draft you edit; publishedVersion is null until you publish:Response
3
Acquire an edit lease
Source code mutations require an edit lease. Acquiring a lease returns a token; acquiring again later replaces it, so the most recent editing session always owns the draft.Learn more in Source code.
Acquire a lease
Response
4
Add a home page
Pages are framework source files. A page imports The page source you just uploaded, formatted for reading:Every successful file write advances the website’s
definePage from @website, declares its route, and renders JSX:Create the home page
Home page source
headVersion.5
Check the draft
Run the framework quality gate before publishing. It validates and type-checks your draft the same way publishing will:A passing check reports the draft version it validated. If the check fails, the response describes each framework error so you can fix the file and retry.
Check the draft
6
Preview the draft
Look up the website’s platform subdomain:Find the domain with
List domains
"kind": "platform_subdomain" and take its hostname, for example acme-plumbing.cactal.app or acme-plumbing-x8k2p7.cactal.app when a uniqueness suffix was needed. The draft preview is served at that hostname with a draft-- prefix:Draft preview URL
Open the draft URL in a browser. You should see your Acme Plumbing home page. Draft previews always show the current head version and are never indexed by search engines.
7
Publish
Publishing builds the draft in an isolated sandbox and, on success, makes it the live version:
Publish the draft
A site counts toward your plan when an organization owner enables custom domains for it. Sites on Cactal domains are unlimited and free. See Plans and limits.
Open
https://acme-plumbing-x8k2.cactal.app (no draft-- prefix). Your website is live.What you built
You created a website, edited its draft under a lease, validated it, previewed it, and published it. The draft/publish split is the core of Cactal: nothing goes live until you publish, and every published version can be rolled back.Next steps
Manage content with the CMS
Model collections and fields, then publish structured content.
Connect a custom domain
Point your own domain at the website and make it primary.
Connect your agent
Run this whole flow through MCP from Claude, Cursor, or any MCP client.
Edit source code
Components, global CSS, page metadata, and custom code slots.
Build pages with CMS data
Query published content through the generated website SDK.
Configure routes and redirects
Define page URLs and safe migrations.
Style a website
Add global CSS, Tailwind utilities, and theme tokens.
Configure SEO metadata
Build titles, social previews, and structured data from CMS content.