# Connect my domain

URL: /products/site/domains/connect-my-domain · Id: `guide:connect-my-domain`

> Say "connect leaseline.com" and get the Domain verified, its DNS records, a certificate and your Site served on it.

Point a [Domain](/business/nouns/domain) you already hold at your [Site](/business/nouns/site). You add three records at your registrar; [DNS records for your domain](/products/site/domains/dns-records) shows each one and how long it takes.

Needs: [Startup](/business/nouns/startup)

**Before it runs**

- Who says yes: You. Your agent shows you the run and waits for your [Approval](/business/nouns/approval).
- You leave the chat: Once, at your domain registrar: to add the three DNS records your agent lists.
- First question at Live: “Move the registration here too, or leave it where it is?”

## What you get
- 1 domain verified through DNS (Domain)
- 4 DNS records for the site, the app and mail (DNS Record)
- 1 certificate, renewed before it expires (Certificate)
- 1 site served at leaseline.com (Site)
- 1 domain cleared for Apple Pay and Google Pay at checkout (Domain)

## Your agent does
**For agents**

- Guide: `guide:connect-my-domain`, status `live`. Page: [/products/site/domains/connect-my-domain.md](/products/site/domains/connect-my-domain.md).
- Approval: ask the founder first. Show the run, then wait for their Approval; a refusal ends it.
- Leaves the chat: Once, at your domain registrar: to add the three DNS records your agent lists.
- Needs first: [Startup](/business/nouns/startup).
- Run: call the steps in order, each through the API, SDK, CLI or MCP tab below; a later step passes the `$id` an earlier one returns. Each value marked example is the sample business’s: pass the founder’s own.

| Step | Verb | Inputs (type, required, this guide’s value) | Returns |
| --- | --- | --- | --- |
| 1 | [`Domain.connect`](/business/nouns/domain/connect) (`verb:Domain.connect`) | `hostname` string, required: example `"leaseline.com"`; `startup` Startup (an id), required: the `$id` of the first Startup `Startup.list` returns | `domain` Domain |

Returns: the last call answers with `domain` and its `action`, whose `status` is `done`, `pending` (waiting on an Approval or a Worker), `failed`, `canceled` or `refused`:

```json
{
  "api": "https://api.sb/leaseline.app",
  "domain": {
    "$id": "https://api.sb/leaseline.app/domains/domain_1",
    "$type": "Domain",
    "hostname": "leaseline.com"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Domain.connect",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/action_1"
  }
}
```

Next: offer “Send leaseline.app to leaseline.com”, or “Give me hello@ and support@ at leaseline.com”.

Calls: `Domain.connect`

Ask:

```text
Connect leaseline.com. I bought it somewhere else.
Use the domain I already own for my site.
Point leaseline.com at the business.
```

API:

```bash
# Look up the Startup: Startup.list
STARTUP=$(curl "https://api.sb/leaseline.app/startups?limit=1" \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" | jq -r '.startups[0]["$id"] | split("/") | last')

# Domain.connect
curl -X POST https://api.sb/leaseline.app/domains/connect \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname":"leaseline.com","startup":"'"$STARTUP"'"}'
```

SDK:

```ts
import { $ } from 'startup-builder'

const [startup] = await $.Startup.list({ limit: 1 })
await $.Domain.connect({ hostname: 'leaseline.com', startup: startup.$id })
```

CLI:

```bash
STARTUP=$(npx startup-builder do Startup.list --json '{"limit":1}' | jq -r '.startups[0]["$id"] | split("/") | last')
npx startup-builder do Domain.connect --json '{"hostname":"leaseline.com","startup":"'"$STARTUP"'"}'
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "const [startup] = await $.Startup.list({ limit: 1 })\nreturn await $.Domain.connect({ hostname: 'leaseline.com', startup: startup.$id })"
  }
}
```

## Change it
- Send leaseline.app to leaseline.com.
- Give me hello@ and support@ at leaseline.com.

## Under the hood
- Systems: [Sites](/products/site/sites)
- Nouns: [Domain](/business/nouns/domain), [DNS Record](/business/nouns/dns-record), [Site](/business/nouns/site)
- Events: [`Domain.connected`](/business/events/Domain.connected)
- Stripe objects: `Payment Method Domain`