Quickstart

From nothing to a sent email in two minutes: create a key, verify a domain, POST one JSON body.

The sending API is a single authenticated endpoint — POST https://api.mail.atrix.dev/v1/emails. Here is the whole loop.

1. Create an API key

In the dashboard, open Settings → API keys → Create key. Give it the email.send scope (add emails.read if you also want to look up delivery status). The full key — beginning am_live_ — is shown once; store it in a secret manager or an environment variable.

shell
export ATRIX_MAIL_KEY="am_live_..."   # shown once, at creation
Keys carry full sending rights. Keep them server-side — never ship one in client JavaScript, a mobile app, or a git repo.

2. Verify a sending domain

You can only send from a domain your organization has verified. Add one under Domains and publish the DNS records we generate — see Domains for the full record set (MX, SPF, DKIM, DMARC, MTA-STS). Sending is enabled once the domain is active.

3. Send your first email

shell
curl -X POST https://api.mail.atrix.dev/v1/emails \
  -H "Authorization: Bearer $ATRIX_MAIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Yourco <hello@yourco.com>",
    "to": ["ava@client.io"],
    "subject": "Hello from Atrix Mail",
    "html": "<p>It works.</p>",
    "text": "It works."
  }'

A 201 Created comes back with the message id. queued means we accepted it; delivery is asynchronous.

json
{
  "id": "6f6d2b1a-3c9e-4a51-8f2b-2d7c1a0e9b44",
  "status": "queued"
}

Same thing with the SDK

The TypeScript SDK wraps the same endpoint with full types:

shell
bun add @atrix-mail/sdk
ts
import { AtrixMail } from "@atrix-mail/sdk";

const mail = new AtrixMail(process.env.ATRIX_MAIL_KEY!);

const { id, status } = await mail.emails.send({
  from: "Yourco <hello@yourco.com>",
  to: "ava@client.io",
  subject: "Hello from Atrix Mail",
  html: "<p>It works.</p>",
  text: "It works.",
});

console.log(id, status); // "<uuid>" "queued"

What next

  1. Track what happens after queued with webhooks — deliveries, bounces, complaints.
  2. Understand keys and scopes.
  3. Read the full request and error reference.