Inbound email parsing.
When someone replies to your agent, you get a structured event. Not raw email. Not MIME blobs. The injection score and sender reputation are always there. It's two lines to start listening.
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.
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.
Register a webhook (or use the reactor).
// 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)
});Built for agents.
Self-serve in minutes.
Public API opens Q3 2026. Drop ~6 lines into your agent and ship.
$ npm install @mailsai/sdk