Feature

Inbound email parsing.

Every inbound to your agent address arrives as a structured event — injection_score + sender_reputation always included; intent, entities, and urgency when you enable classification (opt-in). SES inbound → Lambda → structured reply event. Webhook delivery (HMAC-signed) or SDK reactor.

How it works

Architecture in 4 boxes.

SES inbound → Lambda → structured event

Every inbound MX-routes to AWS SES and fires a Lambda that normalizes the message into a structured reply event; the opt-in classifier adds intent + entities + urgency. Dispatch goes via webhook + SDK reactor in parallel.

Multipart attachments handled

PDFs / images / docs come through as attachment metadata. Atlas use case (document parser) gets attachment.parsed events with extracted fields.

Webhook OR SDK reactor

Same event delivered via HTTPS webhook (HMAC-signed, retried with exponential backoff + DLQ) or via SDK reactor (long-poll). Same payload, different transports.

Thread reconstruction

Replies are linked to the parent send via In-Reply-To headers. event.thread_id ties an entire conversation together.

Set up

Register a webhook (or use the reactor).

two ways to listen
// 1. Register an inbound webhook (one-time)
await mails.webhooks.create({
  url: "https://your-app.com/api/inbound",
  events: ["reply.received"]
});

// 2. Or listen via the SDK reactor (no webhook needed)
const agent = mails.agent("sarah", { domain: "yourcompany.com" });
agent.onReply((event) => {
  // event.injection_score + sender_reputation + body
  // (+ intent + entities with opt-in classification)
});
Closed beta

Built for agents.
Self-serve at every volume.

Public API opens Q3 2026. Drop ~6 lines into your agent and ship.

npmpnpmbunpip
$ npm install @mailsai/sdk
Packages publish with cohort 1 · Q3 2026