curl. Once your domain is
verified, the send itself takes about two minutes.
Before you start
You need:- A Dairo account and an API key.
- A domain you control, so you can publish DNS records to verify it.
1. Install
2. Set your API key
Store your key in an environment variable so it never lands in source control.DAIRO_API_KEY from the environment on their
own. The JavaScript SDK — and the other SDKs — take the key explicitly, so
browser and edge runtimes stay predictable.
3. Verify a domain
Register your domain and Dairo returns the exact DNS records to publish. Once they resolve, your mail authenticates and lands in the inbox.status is verified:
DNS changes can take a few minutes to propagate; each re-check reads your
records fresh. Add & verify a domain has the full
reference, including what each record does.
4. Create an inbox
An inbox is the address you send from and receive replies to.inbox.id — every send names it.
5. Send an email
One call sends a real email. Pass anIdempotency-Key so a retried request
never delivers twice — see Idempotency.
id, the channel it went out on (email), and a definitive
status of sent — or a precise error if something knowable at submit time
is wrong. Keep the id; it links this send to its delivery, bounce, and
complaint events.
If a recipient previously reported your mail as spam, Dairo blocks the send
with a
400 unless you pass ignoreComplaints: true — the response then
carries a warnings entry for that recipient. See
Land in the inbox before overriding.6. Track delivery
Delivery outcomes arrive as events on the message:Delivery when the
recipient’s provider accepts it, Bounce when it can’t be delivered,
Complaint when someone marks it as spam.
message.delivered, message.bounced, and message.complained fire as each
outcome lands.
7. Read the reply
Reply to the email you sent, from your regular mail client. Incoming mail becomes a structured message in the inbox, grouped into a thread with the message it answers.Next steps
- Send an email — HTML, React templates, attachments, CC/BCC, and scheduling.
- Messages & threads — read incoming mail, walk threads, and reply.
- Webhooks — react to events in real time and verify signatures.
- For AI agents — the MCP server, the CLI, and patterns for reliable email agents.