Skip to main content
This guide takes you from an empty organization to a website you can open in a browser, using only the REST API. The same operations are available in the dashboard, where the built-in Cactal agent can run them for you, and over MCP.

Prerequisites

All requests go to the public API host:
1

Find your organization id

Every website belongs to an organization. List the organizations your key can access:
List organizations
The response is an array. Copy the id you want to create the website in:
Response
2

Create a website

Create a website
The response is the new website. headVersion is the draft you edit; publishedVersion is null until you publish:
Response
Cactal also allocates a platform subdomain for the website automatically. You’ll look it up in a later step.
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.
Acquire a lease
Response
Learn more in Source code.
4

Add a home page

Pages are framework source files. A page imports definePage from @website, declares its route, and renders JSX:
Create the home page
The page source you just uploaded, formatted for reading:
Home page source
Every successful file write advances the website’s headVersion.
5

Check the draft

Run the framework quality gate before publishing. It validates and type-checks your draft the same way publishing will:
Check the draft
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.
6

Preview the draft

Look up the website’s platform subdomain:
List domains
Find the domain with "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.