A capture page is a signup landing page hosted by Lumail. Every signup lands in
your audience with the tags you chose. You can build one in the dashboard AI
builder, or ask your own agent to do it through the Lumail skill, the CLI or the
MCP server. All three use the same tools, so a page an agent creates opens in
the builder exactly like one you made there.

## Ask your agent

With the [Lumail skill](/docs/ai-integration/skills-cli) or the
[MCP server](/docs/ai-integration/mcp-claude) installed, describe the page:

<AgentPrompt
  label="Prompt"
  prompt="Build a Lumail capture page for my free SEO checklist for indie hackers. Dark theme, tag signups with seo-checklist. Leave it as a draft and send me the preview link."
/>

The agent reads the page rules with `get_skill({ type: "capture_page" })`,
writes the page, validates it, saves it as a **draft** and gives you two
links: a **preview link** that renders the draft exactly like the live page
(anyone with it can view it for 2 hours, and it records no views or signups),
and the **builder link**, where you preview it on desktop, tablet and mobile
and keep refining it with the in-app AI. Nothing is public until you ask the agent
to publish, or press **Publish** in the builder.

## How a page is made

A page is two files:

| File        | What it holds                                                                        |
| ----------- | ------------------------------------------------------------------------------------ |
| `page.tsx`  | One React component (`export default function App()`), Tailwind classes, no imports. |
| `theme.css` | The `:root` color and font tokens, plus optional `@keyframes`.                       |

Signup forms use the built-in `EmailProvider`, `EmailInput` and `EmailSubmit`
components. Lumail rejects code that fetches URLs, touches `window` or
`document`, uses hooks or event handlers, or imports packages, so a page can
only collect emails for your list.

## From the terminal

The CLI keeps a page in a local folder so an agent (or you) can edit it with
normal file tools:

```bash
npm install -g lumail
lumail auth login

# Start from a template; writes page.tsx, theme.css and capture.json
lumail captures templates
lumail captures create --name "SEO checklist" --template lead-magnet \
  --tags seo-checklist --dir ./capture

# Edit ./capture/page.tsx, then check and save it as the draft
lumail captures validate --dir ./capture
lumail captures push --dir ./capture   # prints a fresh preview link

# Go live when you are happy with the preview
lumail captures publish --dir ./capture
```

If `./capture/page.tsx` already exists, `create --dir` uploads it instead of
starting from the template. `push`, `publish` and `versions` read the page ID
from `capture.json`, so they work without an ID inside that folder.

| Command                            | What it does                                                   |
| ---------------------------------- | -------------------------------------------------------------- |
| `captures list`                    | Pages with status, views, signups, conversion rate and URL.    |
| `captures get <id> [--code]`       | One page, its links and optionally its draft code.             |
| `captures pull <id> --dir <dir>`   | Downloads an existing page into a folder to edit it.           |
| `captures settings <id>`           | Renames it, changes its slug, SEO title and description, tags. |
| `captures versions [id]`           | Published versions and which one is live.                      |
| `captures rollback <id> <version>` | Makes an older version live again and restores it as draft.    |
| `captures delete <id>`             | Deletes the page after a confirmation code.                    |

Add `--json` to any command for machine-readable output.

## Drafts, publishing and versions

- The draft is what the builder shows and what agents edit. Saving a draft
  never changes the live page.
- Publishing turns the current draft into a new version (`v1`, `v2`...) and
  makes it live at the page URL.
- Rolling back makes an older version live and loads it back as the draft.
- Names never clash: creating a second "SEO checklist" gives you
  "SEO checklist (2)".

## Tools reference

Agents call these tools through MCP, the
[Tools API](/docs/ai-integration/tools-api) or the CLI. They need an API token
or MCP connection with the **campaigns** permission.

| Tool                                                  | Purpose                                             |
| ----------------------------------------------------- | --------------------------------------------------- |
| `list_capture_pages`, `get_capture_page`              | Read pages, stats, links and draft code.            |
| `list_capture_page_templates`                         | Built-in designs, optionally with their code.       |
| `validate_capture_page_code`                          | Checks code without saving anything.                |
| `create_capture_page`                                 | Creates a draft from code, a template, or empty.    |
| `update_capture_page`, `update_capture_page_settings` | Saves draft code, or changes name, slug, SEO, tags. |
| `publish_capture_page`                                | Publishes the draft as a new live version.          |
| `list_capture_page_versions`, `rollback_capture_page` | Version history and rollback.                       |
| `delete_capture_page`                                 | Deletes a page (asks for a confirmation code).      |

See the [full tools reference](/docs/ai-integration/tools-reference) for every
input and output field.
