Docs
Build with AI coding agents
Claude Code, Codex, Cursor and VS Code can set up Hatched Send for you: keys, sending domains, webhooks and templates. Three steps: connect the MCP server, paste a prompt, and leave a note in your repo so every future agent session uses the API the right way.
1. Connect the MCP server
One URL for every app: https://send.hatched.digital/mcp. Your app opens Hatched Send to sign in, and you choose the workspaces and permissions (allow Developer setup for keys, domains and webhooks). No API key goes into the config.
In your terminal, then run /mcp and sign in
claude mcp add --transport http hatched-send https://send.hatched.digital/mcpOther apps: ChatGPT, Grok, Windsurf, Zed and more. Building your own agent? Call https://send.hatched.digital/api/mcp with an API key as the bearer token.
2. Paste a prompt
Every prompt starts the agent on a sk_test_ key, so nothing is delivered until you swap in a live key. Campaign sends always ask for your confirmation first.
Add email to this project
Add transactional email to this project with Hatched Send.
Read https://send.hatched.digital/llms.txt first.
1. Use the Hatched Send MCP tools to create a TEST API key and write it to
.env.local as HATCHED_SEND_API_KEY (make sure the file is git-ignored).
2. Add a small sendEmail() helper that POSTs to https://send.hatched.digital/api/v1/email
with an Idempotency-Key header, and send me a test welcome email.
3. Add my domain as a sending domain, show me the DNS records, then verify it.
4. Register a webhook for email.bounced and email.complained at
/api/webhooks/hatched-send and verify its signature.Move off another provider
Replace our current email provider with Hatched Send. Read https://send.hatched.digital/llms.txt.
Find every place we send email, swap each call for POST /api/v1/email with an
Idempotency-Key, keep the same from addresses and templates, and use a test key
until I say go. List anything that has no direct equivalent.Send for my customers on their own domains
Our app sends email on behalf of each customer business. Using Hatched Send
(https://send.hatched.digital/llms.txt): when a customer adds their domain, call POST /api/v1/domains and
show them the DNS records; poll verify until it passes. Send with sender_ref set to
the business id, from_name "<Business> via <OurApp>" and reply_to their address.
Handle 403 sender_paused and the sender.paused webhook.Design a template my team can edit
Use the Hatched Send MCP tools: read our brand with get_brand, write a responsive
MJML order-confirmation template with {{order_id}}, {{items}} and {{total}}, save it
with create_template and give me the preview link. Then change our code to send it
by template_id.Newsletter sign-ups from our site
Wire our sign-up form to Hatched Send: on submit (with the consent box ticked),
call POST /api/v1/contacts with consent: true and our Newsletter audience id from
GET /api/v1/audiences. Keep the key on the server. Then save a welcome automation
with the MCP tools, switched off, and show it to me before turning it on.3. Leave a note for future agents
Add this section to AGENTS.md (Codex, Cursor and most agents) or CLAUDE.md (Claude Code). Or fetch it: curl -s https://send.hatched.digital/docs/agents.md >> AGENTS.md
## Email (Hatched Send)
This project sends email through Hatched Send. Docs for agents: https://send.hatched.digital/llms.txt
- Send: POST https://send.hatched.digital/api/v1/email with `Authorization: Bearer $HATCHED_SEND_API_KEY`.
Body: { from, to, subject, html | text | template_id, variables?, reply_to?, tags? }.
- Always send an `Idempotency-Key` header (e.g. `welcome-<userId>`) so retries never send twice.
- Keys starting `sk_test_` log the email but never deliver it. Use them in dev and CI.
Never commit keys; they live in .env.local / the host's env settings.
- `from` must be on a verified sending domain (GET https://send.hatched.digital/api/v1/domains).
- Delivery events arrive by webhook, signed with `X-HatchedSend-Signature-V1: t=<unix>,v1=<hex>`
(HMAC-SHA256 of `t + "." + rawBody` with HATCHED_SEND_WEBHOOK_SECRET). Verify before trusting.
- Error type `suppressed` (400) means the address bounced, complained or unsubscribed. Don't retry it.
- MCP server for setup tasks (keys, domains, webhooks, templates): https://send.hatched.digital/mcp
Docs for machines
- /llms.txt: a short map of the docs (llmstxt.org format)
- /llms-full.txt: every endpoint, field, error and webhook rule in one file
- /openapi.json: OpenAPI spec
- API docs and connector tools and permissions
Safety rails agents can't skip
- Keys and webhook secrets are shown once and written to your env file, not the chat.
- Test keys never deliver. Live sends to suppressed addresses are refused.
- Campaign sends and automation switches need a one-time code you confirm.
- Viewers in a workspace get read-only access, whatever the agent asks for.