# Get email at my domain

URL: /products/site/domains/get-email-at-my-domain · Id: `guide:get-email-at-my-domain`

> Say "give me dana@leaseline.app" and get a Mailbox, SPF, DKIM and DMARC records verified before the first send, and inbound routing.

A [Mailbox](/business/nouns/mailbox) sends and receives at your [Domain](/business/nouns/domain), for a person or an [Agent](/business/nouns/agent), with mail authenticated before its first send.

Needs: [Buy a domain](/products/site/domains/buy-a-domain)

**Before it runs**

- You leave the chat: Never: it all happens in the chat.
- First question at Live: “For a person or for an agent?”

## What you get
- 1 mailbox at the address, for a person or an agent (Mailbox)
- 3 mail records that prove your mail is yours, checked before the first send (DNS Record)
- 1 record that routes incoming mail to you (DNS Record)
- 1 thread per conversation, inbound and outbound (Thread)
- 1 slow start and daily cap for sales mail, so it lands in inboxes (Mailbox)

## Your agent does
**For agents**

- Guide: `guide:get-email-at-my-domain`, status `beta`. Page: [/products/site/domains/get-email-at-my-domain.md](/products/site/domains/get-email-at-my-domain.md).
- Approval: none. Run it when the founder asks.
- Leaves the chat: never.
- Needs first: [Buy a domain](/products/site/domains/buy-a-domain).
- 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.authenticate`](/business/nouns/domain/authenticate) (`verb:Domain.authenticate`) | `domain` Domain (an id), required: example `"domain_leaseline_app"` | `domain` Domain |
| 2 | [`Mailbox.create`](/business/nouns/mailbox/create) (`verb:Mailbox.create`) | `medium` string, required: example `"email"`; `address` email, required: example `"dana@leaseline.app"`; `stream` string, required: example `"transactional"` | `mailbox` Mailbox |

Returns: the last call answers with `mailbox` 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",
  "mailbox": {
    "$id": "https://api.sb/leaseline.app/mailboxes/mailbox_1",
    "$type": "Mailbox",
    "medium": "email",
    "address": "dana@leaseline.app",
    "stream": "transactional"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Mailbox.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/action_1"
  }
}
```

Next: offer “Route support@ to the support agent”, or “Forward billing@ to my bookkeeper”.

Calls: `Domain.authenticate` → `Mailbox.create`

Ask:

```text
Give me dana@leaseline.app.
Get email at my domain.
Set up support@leaseline.app email for customers.
```

API:

```bash
# 1. Domain.authenticate
curl -X POST https://api.sb/leaseline.app/domains/domain_leaseline_app/authenticate \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"

# 2. Mailbox.create
curl -X POST https://api.sb/leaseline.app/mailboxes \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"medium":"email","address":"dana@leaseline.app","stream":"transactional"}'
```

SDK:

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

await $.Domain.authenticate({ domain: 'domain_leaseline_app' })
await $.Mailbox.create({ medium: 'email', address: 'dana@leaseline.app', stream: 'transactional' })
```

CLI:

```bash
npx startup-builder do Domain.authenticate --json '{"domain":"domain_leaseline_app"}'
npx startup-builder do Mailbox.create --json '{"medium":"email","address":"dana@leaseline.app","stream":"transactional"}'
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "await $.Domain.authenticate({ domain: 'domain_leaseline_app' })\nreturn await $.Mailbox.create({ medium: 'email', address: 'dana@leaseline.app', stream: 'transactional' })"
  }
}
```

## Change it
- Route support@ to the support agent.
- Forward billing@ to my bookkeeper.
- Retire the old hello@ address.

## Under the hood
- Systems: [Mailboxes](/systems/mailboxes)
- Nouns: [Domain](/business/nouns/domain), [Mailbox](/business/nouns/mailbox), [DNS Record](/business/nouns/dns-record), [Thread](/business/nouns/thread)
- Events: [`Domain.authenticated`](/business/events/Domain.authenticated), `Mailbox.created`