<!-- Built by scripts/build-agent-docs.mjs from site/agents-src/domains.md: edit that file. -->
# Page Lemon custom domains: guide for AI assistants

> For people: https://pagelemon.com/docs/connect-domain explains this feature in plain words. This page is for AI assistants.

Putting a site on the person's own address (`www.maisoncafe.co.uk`) instead of `<name>.pagelemon.dev`: finding a name that is free, telling the person where to buy it, connecting it to the site, and checking it is live. The person owns the domain and renews it every year at their registrar; Page Lemon only hosts the site on it, sets up the https certificate and emails the Workspace Owner when it is live. Page Lemon sells no domains and takes no cut. Publishing in general: https://pagelemon.com/agents.

Use this when the person asks for their own address ("Find me a domain for my café", "Connect www.maisoncafe.co.uk to my site", "Is my domain working yet?", "Move my domain to my new site"), or when a site you build for a business should have one.

## Plans and limits

A custom domain needs a kept (claimed) site and a paid plan. How many domains depends on the plan (https://pagelemon.com/pricing), counted across every site the Workspace Owner has, pending and live ones together. The person's own count: `account_read` `what=account` with `expand: "domains"` (`domains_used`, `domains_limit`).

- **Free:** `site_domain_update` `action=add` is refused (`limit`, with `pricing_url` and an `agent_message` saying custom domains need a paid plan). Outside ChatGPT and Codex the reply also says "Not for you? Cancel within 14 days of starting for a refund: in full the first time in 12 months, pro rata after that.": pass it on. The person subscribes in the Page Lemon app. Never retry the same call. Page Lemon has no free trials, and you never start or pay for a plan for the person.
- **All domains used:** the refusal carries `domains_used`, `domains_limit`, `pricing_url` and an `agent_message` with the plan's number. Offer to remove a domain they don't use (`site_domain_remove`) or the pricing link.
- **At most 10 domains added per person a day** and 20 name searches (`site_read` `what=domains`) an hour. Over either, the reply says when to try again.
- Say plan names, never ids.
- After a downgrade, domains over the new plan keep working for the 14-day grace. After it only the account's oldest domains are served; the others send visitors to the site's `pagelemon.dev` address and show "This address is paused". Their settings are kept, and a plan with room (or removing another domain) brings them back.

## A site plus an app: recommend two sites

When the person wants a website and an app (sign-in, lists, bookings), recommend two Page Lemon sites: the marketing site on the root or `www.<domain>`, the app on `app.<domain>` (owner 2026-11-10). Connect each with `site_domain_update` `action=add`; for the root, `www.` or `app.` of a domain the reply carries `connect.app_pair` (`role`, `app_hostname`, `sign_in_url`, `steps`, `docs_url`) and its `agent_message` ends with the steps: add a **Sign in** link on the marketing site to `https://app.<domain>`. The two sites share no sign-in; people sign in on the app. Plain-words guide for the person: https://pagelemon.com/docs/connect-domain#site-and-app.

## Ask the person

Ask in one message:

1. **Do you already own a domain?** If not: the business name or idea, and the endings they like (`com`, `co.uk`, `shop`…). Offer to look for free names.
2. **Which address should open the site?** Recommend `www.<domain>`: it works with every DNS host, and the bare name (`maisoncafe.co.uk`) can be forwarded to it. Connect the bare name itself only when they want it and their DNS host supports it (below).
3. **Where is the domain's DNS managed, and do they have the login?** If they don't know, don't ask them to guess: connect the domain, and the reply names the company (Page Lemon looks up the domain's name servers). If a web designer or IT person runs it, offer `share_url` to send them.
4. **Which site**, when they have several.
5. **Does email run on this domain?** If yes, say now that only the website records change and the email records (`MX`) must stay as they are.

## What the person needs ready

- **A domain they own** (or a card to buy one: about a yearly price, paid to the registrar, not to Page Lemon). `site_read` `what=domains` gives likely-free names with a search link at Porkbun and at Namecheap; any registrar works, the renewal price matters more than the first year, and "likely available" is only the registry having no record, so the registrar's checkout has the last word.
- **The login where the domain's DNS is managed.** This is usually the company they bought the domain from. Where they find out:
  - The receipt or renewal email for the domain ("domain registration", "renewal") names the company.
  - If they don't have it: connect the domain anyway. `site_domain_update` `action=add` replies with the DNS host it found from the name servers (for example Cloudflare, GoDaddy, Namecheap, Porkbun, IONOS, Squarespace Domains, Wix, 123-reg, OVHcloud, Dynadot) and where its DNS settings are, or the registrar when the DNS host is unknown. Pass that on.
  - A domain bought through a website builder or a hosting company has its DNS there, until someone moved it.
  - A web designer or IT person may run it: send them `share_url`; they need no Page Lemon account.
- **Where the DNS settings are**, for the common companies (menu names in bold):

  | DNS host | Where |
  |---|---|
  | Porkbun | Domain Management → **DNS** next to the domain |
  | Namecheap | Domain List → **Manage** → **Advanced DNS** |
  | GoDaddy | My Products → **DNS** next to the domain |
  | Cloudflare | the domain → **DNS** → **Records** (set new records to **DNS only**, the grey cloud) |
  | Squarespace Domains (formerly Google Domains) | Domains → the domain → **DNS** |
  | IONOS | Domains & SSL → the domain → **DNS** |
  | Wix | Domains → the menu next to the domain → **Manage DNS Records** |
  | 123-reg | the domain → **Manage DNS** |
  | OVHcloud | Web Cloud → Domain names → the domain → **DNS zone** |
  | Dynadot | My Domains → Manage Domains → the domain → **DNS Settings** |
  | Anywhere else | a button called DNS, DNS records, Manage DNS or Advanced DNS |

- **For a root domain without `www`:** a DNS host with `ALIAS`, `ANAME` or CNAME flattening (below), or the willingness to use `www` and forward the bare name where the domain was bought.
- Nothing is typed into the chat: no registrar password, ever.

## Set it up

1. **No domain yet:** `site_read` `what=domains` with `q` (a name or idea; no `site`, and optionally `tlds`). It needs a Page Lemon account. Show the candidates with their buy links and approximate yearly prices ("about", never exact), walk a non-technical person through the purchase one step at a time, and wait until they have the domain.
2. **Connect:** `site_domain_update` `action=add` with `site`, `hostname` and, to also make a link for whoever runs the DNS, `share: true` (REST: `POST /v2/sites/<site>/domains` with `{hostname}`). Hostnames are the name only: no `https://`, path or port. Names with accents or other scripts (`café.fr`) work, in Unicode or `xn--`; DNS records use the `xn--` form.

```json
{"site": "site_…", "hostname": "www.maisoncafe.co.uk"}
```

   The reply has the records (`records`: a `CNAME` and a `TXT` at `_pagelemon.<hostname>` with this connection's code), `state` (`pending` until live), and `connect` with the connect steps:
   - **Follow-along steps:** the reply has no one-click link: never promise one click or name a domain company as supporting it. If the DNS is at Cloudflare, tell the person about **Connect Cloudflare** on the site's Domains page in the app: they sign in at Cloudflare, check it says Page Lemon, and allow it once; it adds only the website's records and leaves email alone. Otherwise plain steps with every record, naming the DNS host and where its settings are. Give them in order, one at a time if the person is not technical: delete an old `A`, `AAAA` or `CNAME` with the same name (an old site or a parking page), add the `CNAME`, add the `TXT`, save, leave every other record alone (especially `MX`, which delivers email). If the Name box wants only part, `www` and `_pagelemon.www`; if it wants the whole name, the full name.
   - **Someone else runs the DNS:** `share.share_url` (from `site_domain_update` `action=add` with `share: true`) is a page with the records and the live status, and `share_text` is the same as a message to paste. No account needed to open it.
   Pass on every record and link exact.
3. **A root domain** (`maisoncafe.co.uk`): `site_domain_update` `action=add` looks up the domain's DNS host first. If it can't point a root at Page Lemon, or can't be told, the reply is `added: false` with `recommended: "www.<domain>"` and nothing is created (no slot). Offer the recommendation: connect `www.<domain>` and, where the domain was bought, forward `<domain>` to `https://www.<domain>`. If the person still wants the bare name, call again with `confirm_root: true`.
DNS hosts that handle the bare name (checked October 2026): Cloudflare (free plan, `CNAME` at `@` is flattened), Porkbun, Namecheap and DNSimple (`ALIAS`), Dynadot (`ANAME`), Gandi on LiveDNS (`ALIAS`), DNS Made Easy and Constellix (`ANAME`). For another host, the option is moving the domain's DNS to Cloudflare's free plan (https://pagelemon.com/docs/connect-domain#cloudflare), which keeps the domain registered where it is; copy the email records first.
4. **Come back later:** in a new chat ("is my domain working yet?"), `account_read` `what=account` for the site, then `site_read` `what=site` with `site`, or `site_domain_update` `action=add` again with the same hostname, which repeats the status and steps and adds nothing.

## The app on its own subdomain (a second site)

Recommend this whenever the person is building a website plus an app (owner decision 2026-11-10): the website on the root domain, the app on `app.<domain>`, two sites.

When the person wants their website on one address and their app on `app.<their domain>`, these are two separate Page Lemon sites, each on its own domain. There is no shared sign-in between them.

1. The website has the domain (`www.maisoncafe.co.uk`), live.
2. `site_domain_update` `action=add` on the app site with `app.maisoncafe.co.uk`. If the same account already has the parent domain live on another site, the reply has `verified_parent` and only the `CNAME` record: no TXT. Read out its `agent_message`; give the person the one `CNAME`, then `action=check`.
3. A different domain for the app (`maisoncafe-app.com`) is an ordinary add with both records.
4. The Sign in button: on the website's pages add `<a href="https://app.maisoncafe.co.uk/">Sign in</a>` (the app's address; a private app shows its sign-in page there). Tell the person that signing in on the app does not sign them in on the website.

For the person: https://pagelemon.com/docs/connect-domain#site-and-app

## Confirm with the person

Domains change where the site answers, so tell the person what will happen before you call:

1. Say the exact hostname, the site, that it uses one of the plan's domains, and for a root domain the www recommendation.
2. After the call, show the records or the link exactly as returned. Nothing in DNS changes until the person (or whoever runs their DNS) does it.
3. Disconnecting is two steps: `site_domain_remove` with `site`, `hostname` and `etag` (the domain's `etag` in `domains` from `site_read` `what=site`) returns `confirm_token` and what stops (the site stops answering on the domain at once and stays on its `pagelemon.dev` address; the domain stays with the registrar). Call again with the same `etag` and `confirm_token` only after the person's clear yes.

Adding needs the Workspace Owner (an account, or a token with the Manage permission). Moving a domain to another site: `site_domain_remove` on the old site, then `site_domain_update` `action=add` on the new one; the `CNAME` stays, the `TXT` is new.

## Test

Connecting is not done until it is live:

1. After the person says they clicked **Connect** or saved the records, `site_read` `what=site` with `site` (REST: `POST /v2/sites/<site>/domains/<domain>:verify`). It re-checks a pending domain (at most once every 10 seconds) and adds what Page Lemon sees in public DNS to `agent_message`: a `www` record still pointing at an old site, a mistyped `TXT`, no records yet (new records can take minutes to hours), a domain that doesn't exist yet (bought minutes ago, or not renewed), or a `CAA` record that blocks the certificate.
2. Status goes `pending` (`stage`: `dns`, then `ownership`, then `certificate`) to `active`. Only `active` is live. Don't keep polling in a loop: say what is missing, and ask the person to come back.
3. When it is `active`, open `https://<hostname>` and check it shows the site. If they connected `www`, also open the bare name and check the forwarding. Then tell the person the result. Page Lemon emails the Workspace Owner when the domain goes live; the `pagelemon.dev` address keeps working the whole time.
4. A domain that isn't connected within 7 days of being added is released (add it again whenever ready). A live one that stops answering is emailed about, and released 7 days after it was last live. A live domain that Page Lemon cannot confirm for 3 days stops being served until a check passes again.

## Day to day

- `site_read` `what=site` with `site`: every domain, its status, records, `used` and `limit`.
- `site_domain_remove` (two steps, above), then the DNS records at the registrar can be deleted.
- Changing the site's address (`site_update` `action=settings` `name`) doesn't touch the domain. Transferring the site moves its domains with it, still working; the registration stays in the account where it was bought.
- If the site is deleted, its domains are released.

## What Page Lemon refuses, and the fix

| Refused | Fix to offer |
|---|---|
| Free plan (`limit`: "Custom domains need a paid plan") | The plan and the pricing page, with the 14-day refund line when the reply has it; don't retry |
| All of the plan's domains used | Remove a domain they don't use, or a bigger plan |
| 10 adds in a day, or 20 searches in an hour | Try again after the time in the reply |
| Root domain whose DNS host can't point a root (`added: false`) | `www.<domain>` plus forwarding, or `confirm_root: true` if their DNS host supports `ALIAS`/`ANAME`/flattening, or move the DNS to Cloudflare |
| "Connected to your other site" (`409`) | `site_domain_remove` on that site first (two steps), then add here |
| "Connected to another Page Lemon account" (`409`, `error.claim: true`) | If it is their domain: `site_domain_update` `action=add` with `claim: true` returns one TXT record for whoever runs the DNS; once it is in, the same call checks it and moves the domain here (the other account's owner is emailed). The record is made for this claim only and works for 48 hours. A claim left unverified for 7 days is released anyway |
| "Reserved" (is or looks like a well-known brand; `validation_failed`, reason `domain_reserved`) | Never unlocked by DNS alone, even the brand's exact name on another ending. There is no claim form. If it is their own brand, tell the person to write to Page Lemon with proof of the brand (https://pagelemon.com/support) |
| A TXT proof name that is a CNAME (`cname: true`) | Remove the CNAME at `_pagelemon.<host>` (or add a TXT record at exactly that name), then check again |
| A mixed-alphabet name | Never connects; a name in one alphabet works |
| `pagelemon.com`, `pagelemon.dev`, an IP address, `localhost` | Not possible; ask for their own domain |
| "Only kept sites…" / needs an account | Keep the site first (its keep link), then add the domain |
| An Editor, Staff or Admin asks | Only the Workspace Owner connects domains; ask them to |
| `failed` status | `site_domain_remove`, fix the DNS records, `site_domain_update` `action=add` again |
| `503` custom domains unavailable | Wait the time in `Retry-After` (30 seconds) and try again |

## Links

- For the person: https://pagelemon.com/docs/connect-domain (including the bare domain and moving DNS to Cloudflare)
- API: https://pagelemon.com/docs/api · MCP tools: https://pagelemon.com/docs/mcp
- Fixes by symptom: https://pagelemon.com/docs/fix-a-problem
- All AI guides: https://pagelemon.com/agents
