Transactional email API
Send receipts, password resets, and alerts with one API call. Every email returns an ID you can follow to the inbox.
✓Free to start. Unlimited contacts on every tier.
Receipt accepted
Details
deliveredDelivery events
- RequestIdempotency key verified
- SafetySuppression cleared
- ProviderDelivery accepted
- WebhookDelivered
[ 01 / 06 ]Send
How do I send a transactional email from my app?
Keep the key on the server, give each send an idempotency key, and keep the ID that comes back.
A retry with the same idempotency key returns the original email instead of sending twice.
const response = await fetch("https://sendandretain.com/api/v1/emails", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AEM_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": `receipt-${order.id}`,
},
body: JSON.stringify({
to: order.customerEmail,
template: "receipt",
props: { orderId: order.id, total: order.total },
}),
});
const message = await response.json();Accepted response
{ "id": "msg_…", "status": "queued" }[ 02 / 06 ]Before the first send
What do I need before I send?
Three things. Your agent can do the first two for you.
Verify your domain
Create the domain and add the DNS records you're given (DKIM, a mail-from subdomain, and a tracking record). Sends from an unverified domain are refused.
Publish a template
Write it in react.email, render it, send yourself a test, then publish. Published versions never change.
Create an API key
In Settings → API & MCP, create a "Send + manage" key for your server. It's shown once, so store it as an environment variable.
.envAEM_KEY=aem_...
[ 03 / 06 ]Use cases
What counts as a transactional email?
Email someone needs because of something they did. It still sends after they unsubscribe from marketing.
Receipts and invoices
Sent the moment an order or payment goes through.
Password resets and sign-in links
Time-sensitive email that has to land first time.
Account alerts
Security notices, usage warnings, and failed payments.
Order and shipping updates
Confirmations and tracking, on the same contact record as your marketing email.
[ 04 / 06 ]Send path
What happens between the API call and the inbox?
Your setup is checked straight away. Everything about the recipient is checked again right before the email sends.
- An unknown template, unverified sender, or revoked key fails inline with a 4xx.
- The same idempotency key never sends twice.
- Suppressions, address verification, the pause switch, and the daily cap run right before it sends.
- The returned ID links your request to every delivery event, and signed webhooks push them to you.
Receipt accepted
Details
deliveredDelivery events
- RequestIdempotency key verified
- SafetySuppression cleared
- ProviderDelivery accepted
- WebhookDelivered
[ 05 / 06 ]One system
Do I need a separate tool for marketing email?
No. Your receipts and your marketing automations share one contact record here.
Marketing automations
A second tool, synced by hand
Built in, on the same contacts
Unsubscribes
You build the page and the list
Hosted unsubscribe page and one-click headers
Bounces and complaints
You read webhooks and suppress yourself
Suppressed automatically
Your own provider
Locked to one vendor
Our infrastructure, or your own Resend or SendGrid key
Questions people ask us
Send your first transactional email today.
Verify a domain, publish a template, and send one with an idempotency key.