URL: /code/files/domains · Id: `page:/code/files/domains`

# The domains/ folder: one file and what it compiles to

> What one domains/ file holds, what each key compiles to, and the checks that read it.

One `domains/` file is one [Domain](https://startupbuilder.dev/business/nouns/domain) and what it does: the site, or the email it sends from. SiteBuilder compiles it; the pages here read what it makes.

```mdx title="domains/leaseline.app.mdx"
---
role: email
email: { mailboxes: [dana] }
---
Mail sends from dana@leaseline.app.
```

```text title="show"
$ npx startup-builder show domains/leaseline.app.mdx
role   email                  domains/leaseline.app.mdx:2
email  { mailboxes: [dana] }  domains/leaseline.app.mdx:3
owner  SiteBuilder
```

```text title="leaseline.app"
leaseline.app/
├── plays/
│   ├── cold-email.mdx
│   ├── warm-intros.mdx
│   ├── signup-interviews.mdx
│   ├── lead-reactivation.mdx
│   └── events-and-webinars.mdx
├── audiences/
│   ├── small-property-managers.mdx
│   ├── lapsed-leads.mdx
│   └── renewal-season.mdx
├── sequences/
│   └── cold-email-thread-founder.mdx
├── funnels/
│   └── signup.mdx
├── workflows/
│   └── outbound.mdx
├── agents/
│   ├── sales/prospector.mdx
│   └── marketing/content-lead.mdx
├── systems/
│   └── sequences.mdx
├── domains/   ← this folder
│   └── leaseline.app.mdx
├── offers/
│   ├── pro.mdx
│   └── team.mdx
├── content/
│   └── webinars/60-day-notices.mdx
├── metrics/
│   ├── q4.mdx
│   └── positive-reply-rate.mdx
└── startups.lock
```

## The file
| Key | On the page | Compiles to | Checked by |
| --- | --- | --- | --- |
| `role` | Used for | what the Domain serves; `email` adds its sending records (<Op verb="Domain.authenticate" />) | — |
| `email` | Inboxes | one Mailbox per name, each warmed before its first cold email | — |

## Checks
| Check | It holds | What dev prints |
| --- | --- | --- |
| [S2](/code/checks#s2) | Every send passes a code-tier Check before it goes. | `sequences/cold-email-thread-founder.mdx:5  S2  steps.second sends with no code-tier Check. Add guards: [customer-collision].` |

## Refusals
| Code | Fix, then the call that clears it |
| --- | --- |
| [`claim`](/code/refusals#check-claim) | Cut the line, or cite the Offer term that grants it. Then <Op verb="Conversation.answer" />. |
| [`customer-collision`](/code/refusals#check-customer-collision) | Send it to their CSM instead: the Contact leaves the List. Then <Op verb="Lead.assign" />. |
| [`domain-authenticated`](/code/refusals#check-domain-authenticated) | Add the 3 DNS records shown; it passes once they resolve, often within an hour. Then <Op verb="Domain.authenticate" />. |
| [`mailbox-warm`](/code/refusals#check-mailbox-warm) | Wait for the warm-up to finish, 14 days from day 0; warm intros keep running. Then <Op verb="Mailbox.warm" />. |
| [`owned-by-a-person`](/code/refusals#check-owned-by-a-person) | Leave it to the person who owns it: the draft waits in their queue. Then <Op verb="Task.assign" />. |
| [`price`](/code/refusals#check-price) | Get the discount approved, or quote at the floor. Then <Op verb="Approval.approve" />. |
| [`spam-brake`](/code/refusals#check-spam-brake) | Send to a smaller List, or wait an hour for the rate to fall. Then <Op verb="Message.broadcast" />. |
| [`visit-capture`](/code/refusals#check-visit-capture) | Serve your Site from your Domain and publish the visitor notice; lookups start when both pass. Then <Op verb="Domain.connect" />. |

## Calls

```text title="domains/ compiled · Ask"
Set up leaseline.app for email and check its records, as a dry run.
```

```ts title="domains/ compiled · SDK"
import { $ } from 'startup-builder'

await $.Domain.authenticate({ domain: 'domain_1' }, { mode: 'try' })   // domains/leaseline.app.mdx
return await $.Domain.verify({ domain: 'domain_1' }, { mode: 'try' })   // passes once the records resolve
```

```json title="domains/ compiled · Response · sample"
{
  "checks": {},
  "domain": {
    "$id": "https://api.sb/leaseline.app/domains/domain_1",
    "$type": "Domain",
    "hostname": "leaseline.app",
    "role": "canonical",
    "state": "verifying"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Domain.verify",
    "status": "done"
  }
}
```

| Call | What it does |
| --- | --- |
| <a id="domain-authenticate"></a><Op verb="Domain.authenticate" /> | Authenticate writes a Domain’s SPF, DKIM and DMARC records and verifies them before its first send. Emits [`Domain.authenticated`](/code/events#domain-authenticated). |
| <a id="domain-verify"></a><Op verb="Domain.verify" /> | Verify checks a Domain’s DNS, ownership and certificate again and records each result, with the fix for any failure. Emits [`Domain.verified`](/code/events#domain-verified). |
| <a id="domain-connect"></a><Op verb="Domain.connect" /> | Connect attaches a hostname a Startup already holds and verifies ownership through DNS. Emits [`Domain.connected`](/code/events#domain-connected). |
| <a id="mailbox-warm"></a><Op verb="Mailbox.warm" /> | Warm ramps a new Mailbox from a few sends a day to its cap over two to four weeks. Emits [`Mailbox.warmed`](/code/events#mailbox-warmed). |