Email API for AI agents. Transactional sends + typed inbound events + threading + drafts + suppression. One Authorization header, one resource verb each.
# Install the SDK
npm install @mailsai/sdk
# Or skip the SDK — curl works
curl -X POST https://api.mails.ai/v1/messages \
-H "Authorization: Bearer mk_live_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"agent": "sarah",
"to": "lead@acme.com",
"subject": "Demo confirmation",
"body_text": "Confirmed for Tuesday at 2pm ET."
}'import { mails } from "@mailsai/sdk";
const sarah = mails.agent("sarah");
// Send
await sarah.send({
to: "lead@acme.com",
subject: "Demo confirmation",
body: "Confirmed for Tuesday at 2pm ET.",
});
// Listen for replies
sarah.listReplies({ limit: 10 }).then((evts) => {
for (const e of evts.data) {
if (e.intent === "schedule_meeting") {
/* hand off to your scheduler */
}
}
});