# Let your AI agent set up MailMoose

> Your coding agent can create a MailMoose account, connect your domain and send email for you over HTTP. You only pass it one code from your inbox.

Source: https://www.mailmoose.dev/docs/integrations/agent-signup
Last updated: 2026-11-29

An AI agent that can make HTTP requests, such as Claude Code or Codex, can set up MailMoose for you from start to finish: create your account, connect your domain and send email from it. You never have to open the website. The only thing you do is read the agent a 6-digit code from your inbox.

New accounts start on the free plan: 3,000 emails per 30 days, 3 domains and 5 inboxes. Upgrading is something you do yourself, in **Settings → Billing**.

## Copy this into your agent

```
Set up MailMoose (mailmoose.dev) so this project can send email from my domain.
Follow https://www.mailmoose.dev/docs/integrations/agent-signup.md: sign me up
with my email address, ask me for the code MailMoose emails me, then connect my
domain, show me the DNS records to add, and send me a test email once it's verified.
```

The agent will ask for your email address and your domain if it doesn't know them.

## What the agent does

Everything below is for the agent. Base URL: `https://www.mailmoose.dev`. All requests and responses are JSON. Every error response has a plain-English `message` that can be shown to the person as is.

### 1. Start sign-up

```
POST /api/agent/signup
{ "email": "person@example.com" }
```

Returns `202` with a `signupId`. MailMoose emails the person a 6-digit code with the subject “Your MailMoose code”. Ask them for it. The code expires after 10 minutes.

Temporary or throwaway addresses (such as Mailinator) are refused with `400 disposable_email`. Starting sign-up is limited to 3 times per address per hour (`429 rate_limited`).

### 2. Verify the code

```
POST /api/agent/signup/verify
{ "signupId": "…", "code": "482913" }
```

Returns `200` with an `apiKey`. Store it straight away: it is shown once. Use it as `Authorization: Bearer <apiKey>` for everything below.

- `accountCreated: true`: a new account was created on the free plan.
- `accountCreated: false`: the address already had an account, and the key belongs to it.

The key has full access: read mail, send mail and manage domains. The person gets an email confirming it, with a link to revoke it instantly if they didn't ask for this.

| Status | `error` | What to do |
| --- | --- | --- |
| 400 | `wrong_code` | Ask the person to check the code. `attemptsLeft` says how many tries remain. |
| 410 | `expired` | The code expired or was used. Start again at step 1. |
| 429 | `too_many_attempts` | Five wrong codes. Start again at step 1. |
| 409 | `login_exists` | The address has a login that was never opened. Ask the person to sign in once at mailmoose.dev, then retry. |
| 403 | `no_workspace` | The person isn't the owner of a workspace. They need to create the key themselves. |
| 503 | `unavailable` | Temporary problem. Retry the same code in a minute. |

### 3. Connect the domain

```
POST /api/v1/domains
{ "name": "yourdomain.com" }
```

The response lists the DNS records still to add. If you can manage the person's DNS (for example through a Cloudflare or Vercel tool), add them; otherwise show them to the person. Then turn on sending:

```
POST /api/v1/domains/yourdomain.com/sending
```

This returns the extra records that authorise sending. Check progress after the records are added (not in a tight loop; each call checks public DNS):

```
GET /api/v1/domains/yourdomain.com
```

### 4. Create an address

```
POST /api/v1/addresses
{ "localPart": "hello", "domain": "yourdomain.com" }
```

### 5. Send

```
POST /api/v1/messages
{
  "from": "hello@yourdomain.com",
  "to": ["person@example.com"],
  "subject": "MailMoose is set up",
  "body": "Sent by your agent through MailMoose.",
  "confirmNewRecipient": true
}
```

Because this key can also read mail, sending to an address MailMoose has never seen needs `"confirmNewRecipient": true`. Only set it for recipients the person approved.

For the app's own email (password resets, receipts), create a separate send-only key and use the Resend-compatible `POST /api/v1/emails`. See [Using the API](https://www.mailmoose.dev/docs/integrations/using-the-api.md) and [Migrate from Resend](https://www.mailmoose.dev/docs/integrations/migrate-from-resend.md).

## For people

- **Nothing happens without the code.** If you get a code you didn't ask for, ignore it.
- **Every key an agent creates** shows up in **Settings → API keys** as “Created by AI agent”. Revoke it there, or with the link in the confirmation email.
- **Signing in later:** use Google, or **Forgot password** on the sign-in page to set a password for the account your agent created.

A machine-readable description of the whole API is at [/openapi.json](https://www.mailmoose.dev/openapi.json).
