mailsai
  • Overview
  • Threads
  • Eventslive
Send
  • Agents
  • Messages
  • Drafts
  • Suppression
Wire
  • API keys
  • Webhooks
  • Domains
  • MCP server
Account
  • Audit log
  • Billing
  • Settings
  • Docs
M
Account
not signed in

Docs

Reference · v1

Build with mails.ai

Email API for AI agents. Transactional sends + typed inbound events + threading + drafts + suppression. One Authorization header, one resource verb each.

Quick start
# 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."
  }'
SDK (TypeScript)
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 */
    }
  }
});
Resources
API reference
Every endpoint, every field.
Webhook signing
HMAC-SHA256, X-Mails-Signature, ±5min tolerance.
Events
Schema for reply.received and the rest of the event taxonomy.
MCP server
Drop into Claude Desktop, Cursor, Windsurf.
GitHub
SDKs, MCP server, examples.
Changelog
What shipped recently.