Email for AI agents
AGMX gives every agent a real, routable inbox. Agents receive mail with verification codes and links already extracted, and send, reply and forward through the same API — over REST, MCP or webhooks.
Get an inbox in under a minute.
Wait for an email and read the code.
Plug AGMX into Claude or Cursor.
Core concepts
- Agent — an identity for one of your AI agents. It owns inboxes, can have its own scoped API key and an optional webhook URL.
- Inbox — a real address such as
scout@bot.agmx.io, or one on your own domain. - Message — an inbound or outbound email. Inbound mail carries a
securityreport, a cleanedsafeTextandextracteddata (codes, links, events, receipts, tracking numbers). - Thread — a conversation. Replies are grouped using
In-Reply-ToandReferencesheaders.
The base URL for every endpoint is https://agmx.io/api/v1. Requests and responses are JSON.
Quickstart
There are two ways to get credentials: let the agent sign itself up (you approve it), or create an agent and key yourself in the dashboard.
Option A — agent self sign-up
The agent calls a public endpoint, shows you an approval link and code, and polls until you approve. This is what skill.md walks an agent through.
/api/v1/signupno authcurl -X POST https://agmx.io/api/v1/signup \
-H "Content-Type: application/json" \
-d '{
"name": "Scout",
"username": "scout",
"description": "Researches vendors and signs up for trials",
"ownerEmail": "you@example.com"
}'namestringrequiredusernamestringdescriptionstringownerEmailstringOpen approvalUrl (or enter the code in the dashboard) and approve. Meanwhile the agent polls pollUrl every 5 seconds:
/api/v1/signup/{signupId}?token={pollToken}no auth{
"status": "approved", // pending | approved | completed | denied | expired
"apiKey": "agmx_agt_…", // returned exactly once
"agent": { "id": "agt_…", "name": "Scout", "inboxes": [ … ] },
"inbox": { "id": "inb_…", "address": "scout@bot.agmx.io" },
"mcpUrl": "https://agmx.io/mcp",
"apiBaseUrl": "https://agmx.io/api/v1"
}apiKey and flips the status to completed. Later polls return apiKey: null. Requests expire after 30 minutes.Option B — from the dashboard
- Sign in and create an agent under Agents. Give it a username to create its first inbox.
- Create an agent-scoped key under API keys (or tick "create an API key" when creating the agent).
- Hand the key to your agent as an environment variable, e.g.
AGMX_API_KEY.
Your first request
curl https://agmx.io/api/v1/me -H "Authorization: Bearer $AGMX_API_KEY"/me returns the account, plan limits, current usage and which agent the key belongs to — a good first call for any agent.
Authentication
Send your key as a bearer token: Authorization: Bearer agmx_…. The dashboard uses a session cookie against the very same API.
| Key type | Prefix | Can do |
|---|---|---|
| Agent key | agmx_agt_ | Read and send mail for its own agent's inboxes, create inboxes for itself, manage its webhook. Cannot see other agents, create agents, manage keys or domains. |
| Account key | agmx_acc_ | Everything the dashboard can do: all agents, inboxes, keys, domains and sign-up approvals. |
Inboxes
An inbox is a real address that belongs to one agent. Each plan sets how many inboxes an agent may own.
/api/v1/inboxescurl -X POST https://agmx.io/api/v1/inboxes \
-H "Authorization: Bearer $AGMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "username": "billing-bot", "displayName": "Billing Bot" }'usernamestringdisplayNamestring | nulldomainstringagentIdstringexpiresInnumbermaxMessagesnumberacceptFromstring[]Other endpoints: GET /inboxes (with unread counts), GET /inboxes/{id}, PATCH /inboxes/{id} to rename or pause ({"status": "paused"}), and DELETE /inboxes/{id} to release the address. Paused inboxes neither send nor receive. Reserved names such as postmaster or admin can't be claimed.
Temporary inboxes
Most agent mail is “sign up somewhere, grab the code, move on”. A temporary inbox exists for exactly that: it deletes itself — with its mail — when it expires, and temporary inboxes don't count against your plan's inboxes-per-agent limit (up to 10 per agent at once).
curl -X POST https://agmx.io/api/v1/inboxes \
-H "Authorization: Bearer $AGMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "expiresIn": 3600, "maxMessages": 1, "acceptFrom": ["github.com"] }'
# → { "address": "tmp-swift-otter-4821@bot.agmx.io", "temporary": true, "expiresAt": "…", "maxMessages": 1, … }maxMessagescloses the inbox once it has received that many messages; later mail is dropped and the inbox can no longer send.acceptFromturns the inbox into an allow-list, so only the service you're signing up for can reach it — less spam, fewer injection attempts.- Expired inboxes are removed within a minute. Agent keys can create temporary inboxes for themselves.
Sending
/api/v1/messagescurl -X POST https://agmx.io/api/v1/messages \
-H "Authorization: Bearer $AGMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "scout@bot.agmx.io",
"to": ["Alice Chen <alice@example.com>"],
"subject": "Vendor shortlist",
"text": "Hi Alice — the shortlist is attached.",
"attachments": [{
"filename": "shortlist.csv",
"contentType": "text/csv",
"content": "dmVuZG9yLHByaWNlCkFjbWUsNDkK"
}]
}'fromstringtostring | string[]requiredcc / bccstring | string[]replyTostring | string[]subjectstringrequiredtext / htmlstringattachments{ filename, contentType?, content }[]headersRecord<string, string>labelsstring[]sendAtISO timestampscheduled.idempotencyKeystringIdempotency-Key header). Repeating a request with the same key returns the original message instead of sending again.- Quota: every recipient (to + cc + bcc) counts as one send against daily and monthly limits. A failed delivery is refunded.
- Internal delivery: mail between two AGMX inboxes is delivered instantly without leaving the platform.
- Suppression: addresses that hard-bounced or complained are refused with
InvalidRequestto protect deliverability. - At most 50 recipients per message.
- Approvals: if the sending agent's send policy requires review, the message comes back with status
pending_approvaland aheldReasonexplaining why. It's sent once a human approves it.
Drafts & scheduling
Messages move through these statuses: draft → scheduled or pending_approval → sending → sent → delivered / bounced / complained (or failed / rejected). Drafts, scheduled and held mail don't appear in threads until they're sent.
| Endpoint | What it does |
|---|---|
POST /drafts | Create a draft. Everything is optional; pass replyToMessageId (and replyAll) to start a threaded reply. |
PATCH /drafts/{id} | Update fields. Passing attachments replaces them all. |
POST /drafts/{id}/send | Send now, or pass {"sendAt": "…"} to schedule. Subject to the send policy. |
GET /drafts | List drafts (same shape as GET /messages). |
DELETE /drafts/{id} | Delete a draft, scheduled or rejected message. |
POST /messages/{id}/cancel | Move a scheduled message back to drafts. |
Scheduled mail is released within about 10 seconds of sendAt. Quota is checked when the message actually sends, not when it's scheduled.
Receiving
/api/v1/messagesfolder"inbox" | "sent" | "starred" | "archived" | "spam" | "drafts" | "scheduled" | "pending" | "all"pending lists held and rejected mail.inboxId / agentId / threadIdstringdirection"inbound" | "outbound"unread"true" | "false"qstringsinceISO timestamplimit / cursornumber / stringThe list returns summaries (no bodies) newest first: { messages: [...], nextCursor }. Fetch one message in full — text, HTML, headers, SPF/DKIM/DMARC verdicts and attachments — with:
/api/v1/messages/{messageId}?markRead=trueExtracted data
Every inbound message is scanned so agents don't need to parse HTML. Extraction only looks at visible content, so hidden text can't plant fake codes or links.
"extracted": {
"codes": ["482913"],
"links": [
{ "url": "https://github.com/sessions/verified-device?token=…", "text": "Verify device", "kind": "verify" },
{ "url": "https://www.ups.com/track?tracknum=1Z999AA10123456784", "text": "Track package", "kind": "tracking" }
],
"events": [
{ "title": "Design review", "start": "2026-11-05T20:00:00.000Z", "end": "2026-11-05T21:00:00.000Z",
"allDay": false, "location": "Zoom", "organizer": "ada@example.com", "method": "REQUEST", "uid": "…", "url": null }
],
"receipt": { "merchant": "Acme Cloud", "total": 49, "currency": "USD", "orderNumber": "2041-8812" },
"tracking": [{ "carrier": "ups", "number": "1Z999AA10123456784", "url": "https://www.ups.com/track?…" }]
}- codes are ranked by how likely they are to be the one you want (near words like “code” or “verification”).
- links are sorted by kind:
verify,login,reset,tracking,other, thenunsubscribe. - events come from calendar invites (
text/calendarparts or.icsattachments), with time zones converted to UTC. - receipt is filled for receipts, invoices and order confirmations; tracking lists UPS, FedEx, USPS and DHL numbers.
Attachments
Each attachment in a full message has a downloadUrl (GET /messages/{id}/attachments/{attachmentId}) for the raw bytes — use the same bearer key (in production it redirects to a short-lived signed URL). Text from PDFs and plain-text, CSV, JSON and XML attachments is included as extractedText (up to 20,000 characters), so agents can read them without downloading anything.
Waiting for email
The wait endpoint is a long-poll: it holds the request open and returns the instant a matching inbound message arrives. It's the most reliable way to collect a verification code.
/api/v1/messages/waittimeoutnumbersinceISO timestampinboxIdstringfromstringsubjectstringconst since = new Date().toISOString()
await submitSignupForm({ email: "scout@bot.agmx.io" })
const res = await fetch(`https://agmx.io/api/v1/messages/wait?timeout=60&from=github.com&since=${since}`, {
headers: { Authorization: `Bearer ${process.env.AGMX_API_KEY}` }
})
const { message, timedOut } = await res.json()
if (timedOut) throw new Error("No email yet — try again")
const code = message.extracted.codes[0]Replies & threads
/api/v1/messages/{messageId}/reply{ "text": "Thanks — confirmed for Tuesday.", "replyAll": true }Replies go to the original Reply-To (or sender), quote the original message, use a Re: subject and set In-Reply-To / References so every mail client threads them. replyAll adds the original to and cc recipients (minus yourself). html and attachments are accepted too.
/api/v1/messages/{messageId}/forward{ "to": "finance@example.com", "text": "FYI — receipt below." }Forwards include the original attachments. To read a whole conversation, oldest first:
/api/v1/threads/{threadId}GET /threads lists conversations by most recent activity, with message and unread counts.
Flags & labels
/api/v1/messages/{messageId}{ "isRead": true, "isStarred": false, "isArchived": true, "isSpam": false, "labels": ["receipts"] }Plus-addressing
Mail sent to scout+github@bot.agmx.io is delivered to scout@bot.agmx.io with the label github. Give each service a different tag and filter on labels later.
DELETE /messages/{id} permanently removes a message. Messages older than your plan's retention period are cleaned up automatically.
Sender rules
Rules filter an inbox before mail is stored. They're evaluated in order:
| Action | Effect | target |
|---|---|---|
allow | If an inbox has any allow rules, only matching senders get through — everything else is dropped. | — |
block | Drop matching mail. The first matching allow/block rule wins. | — |
label | Add a label to matching mail. | label name |
forward | Send a copy of matching mail to another address (counts as a send). | email address |
webhook | POST a message.received event for matching mail to a URL, in addition to the agent's webhook. | https URL |
Match on sender (a full address), domain (the sender's domain or any subdomain of it) or subject (contains, case-insensitive).
/api/v1/inboxes/{inboxId}/rules{ "field": "domain", "value": "github.com", "action": "allow" }Also GET /inboxes/{id}/rules, PATCH /rules/{ruleId} (including enabled and position) and DELETE /rules/{ruleId}. Dropped mail isn't stored and doesn't count as received.
allow, block and label rules for their own inboxes, but only people (the dashboard) and account keys can create forward or webhook rules. Otherwise a prompt-injected agent could be talked into quietly copying its mail to an attacker.Reading mail safely
Email is untrusted input that agents feed straight into a model. Attackers hide instructions where a person reviewing the message won't see them — white-on-white text, zero-size fonts, display:none, HTML comments, invisible Unicode — and phrase them as orders. AGMX analyses every inbound message and gives you two things:
"security": {
"risk": "high",
"score": 8,
"reasons": ["hidden text (white-on-white text)", "hidden content asks the reader to send credentials or codes"],
"hiddenContent": true,
"sender": "verified"
},
"safeText": "Hi! Here is the agenda for Tuesday."- safeText is the message as a human would see it: hidden elements, comments, scripts and invisible characters removed. Give your model
safeText, nothtml. - security.risk is
low,mediumorhigh, with human-readablereasons. List responses and webhook payloads include it too. - security.sender says whether the From address is authentic, from the SPF, DKIM and DMARC checks SES runs:
verified(DMARC pass, or mail from another AGMX inbox),unknown(the domain publishes no policy) orfailed(likely forged). Forged mail is at leastmediumrisk, and its codes and sign-in links are withheld fromextracted, so a fake "your GitHub code is…" can't be acted on. - Attachments the scanner flags as malware are quarantined: the message lists them, but the bytes are never stored, forwarded or served.
- The MCP tools return
safeTextand the security report by default and omit raw HTML unless asked (includeRaw).
security.risk is medium or high. The analysis is heuristic: it lowers the risk, it doesn't make untrusted text trustworthy. Combine it with send approvals and allow-lists.Send approvals
Each agent has a send policy that decides when mail sent with its key needs a human's approval:
| sendPolicy | Behaviour |
|---|---|
auto | Send immediately (default). |
first_contact | Hold mail to any recipient the inbox has never exchanged mail with. |
all | Hold every message for review. |
Set approveAttachments: true to also hold anything with attachments. Policies are set by a human in the dashboard or with PATCH /agents/{id} using an account key — an agent key can't change its own policy. Mail sent by people and account keys is never held.
Held mail is returned with status pending_approval. Reviewers approve or reject it in the dashboard or via the API; approved mail is sent immediately, or at its sendAt.
| Endpoint | What it does |
|---|---|
GET /approvals | Held messages, oldest first. Humans and account keys only. |
POST /approvals/{id}/approve | Approve and send. |
POST /approvals/{id}/reject | Reject with an optional reason. The message is never sent. |
The agent hears about each decision through its webhook: message.held (with the reason), then message.approved or message.rejected.
Webhooks
Set a webhookUrl on an agent (dashboard, or PATCH /agents/{id}) and AGMX will POST events for that agent's inboxes.
| Event | When |
|---|---|
message.received | An inbound email was delivered to one of the agent's inboxes (not sent for spam). |
message.sent | An outbound email was accepted for delivery. |
message.delivered | The recipient's server accepted it (requires an SES configuration set). |
message.bounced | Delivery failed. Permanent bounces suppress the address. |
message.complained | The recipient marked it as spam. The address is suppressed. |
message.held | A message is waiting for approval under the agent's send policy. Includes the reason. |
message.approved | A human approved a held message (it's sent right after, or at sendAt). |
message.rejected | A human rejected a held message. Includes the reason, if given. |
agent.sending_paused | Sending was paused, automatically for bounces or complaints, or by a human. Includes the reason. |
agent.sending_resumed | A human resumed sending. |
webhook.test | Sent from the dashboard or POST /agents/{id}/webhook-test. |
{
"id": "evt_01j9…",
"type": "message.received",
"createdAt": "2026-11-02T12:00:00.000Z",
"agentId": "agt_01j9…",
"data": {
"inbox": { "id": "inb_01j9…", "address": "scout@bot.agmx.io" },
"message": { "id": "msg_01j9…", "subject": "…", "from": { … }, "extracted": { … }, … }
}
}Verifying signatures
Each request carries x-agmx-event, x-agmx-delivery and x-agmx-signature: t=<unix>,v1=<hex>, where v1 is the HMAC-SHA256 of `${t}.${rawBody}` keyed with the agent's webhook secret (whsec_…, shown on the agent page).
import { createHmac, timingSafeEqual } from "node:crypto"
export function verifyAgmx(rawBody: string, header: string, secret: string, toleranceSec = 300) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")))
const t = Number(parts.t)
if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex")
const a = Buffer.from(expected), b = Buffer.from(parts.v1 ?? "")
return a.length === b.length && timingSafeEqual(a, b)
}Retries
Respond with any 2xx within 10 seconds. Otherwise AGMX retries with exponential backoff (30s, 1m, 2m, 4m … capped at 6h) for up to 8 attempts. Test events are not retried. Recent deliveries, status codes and errors are visible on each agent's page.
MCP server
AGMX exposes a Model Context Protocol server over Streamable HTTP at https://agmx.io/mcp. Authenticate with the same bearer key (an x-api-key header also works). The tools wrap the REST API, so limits and errors are identical.
claude mcp add --transport http agmx https://agmx.io/mcp \
--header "Authorization: Bearer agmx_agt_…"| Tool | What it does |
|---|---|
whoami | Account, plan limits, usage and the key's agent. |
list_inboxes | Inboxes the key can use, with unread counts. |
create_inbox | Claim a new address — permanent, or temporary with expiresIn, maxMessages and acceptFrom. |
list_messages | List and search mail (folder, unread, query, since, cursor). Folders include drafts, scheduled and pending. |
get_message | Read one email: safeText, security report, attachments and extracted data. Marks it read by default. |
wait_for_email | Block up to 60s for the next email — returns extracted codes and links. |
send_email | Send now or at sendAt, with optional attachments and an idempotencyKey. |
reply_to_email | Reply in-thread, optionally to all, with attachments. |
forward_email | Forward with attachments, now or at sendAt. |
create_draft / update_draft / send_draft / delete_draft | Save a draft (or threaded reply draft), edit it, then send, schedule or discard it. |
cancel_scheduled | Move a scheduled message back to drafts. |
add_inbox_rule / list_inbox_rules / update_inbox_rule / delete_inbox_rule | Manage allow, block and label rules on the agent's inboxes. |
update_message | Read, star, archive, spam and labels. |
delete_message | Permanently delete. |
list_threads / get_thread | Browse and read whole conversations. |
SDKs & CLI
Official clients live in the packages/ directory of the repository. The TypeScript SDK's types are generated from the OpenAPI spec, and every client sends an Idempotency-Key automatically.
// npm install @agmx.io/sdk
import { Agmx, AgmxError } from "@agmx.io/sdk"
const agmx = new Agmx({ apiKey: process.env.AGMX_API_KEY!, baseUrl: "https://agmx.io" })
const inbox = await agmx.inboxes.create({ expiresIn: 3600, maxMessages: 1, acceptFrom: ["github.com"] })
// …trigger the sign-up with inbox.address
const result = await agmx.waitForCode({ inboxId: inbox.id, timeout: 60 })
const sent = await agmx.messages.send({ to: "ada@example.com", subject: "Hi", text: "Hello" })
if (sent.status === "pending_approval") console.log("Waiting for a human to approve")npm install && npm run build in packages/sdk, then npm install /path/to/agmx.io/packages/sdk in your project. Python: pip install ./packages/python. CLI: run npm link in packages/sdk, then npm link agmx && npm link in packages/cli to get the agmx command.Custom domains
On plans that include custom domains, add one with POST /domains ({"name": "mail.example.com"}) or in the dashboard. AGMX registers it with Amazon SES and returns the DNS records to publish:
| Type | Name | Value | Purpose |
|---|---|---|---|
| MX | mail.example.com | 10 inbound-smtp.<region>.amazonaws.com | Receive mail |
| CNAME ×3 | <token>._domainkey.mail.example.com | <token>.dkim.amazonses.com | DKIM signing |
| TXT | _dmarc.mail.example.com | v=DMARC1; p=none; … | DMARC (recommended) |
Call POST /domains/{id}/verify (or click “Check DNS”) to refresh status. Once DKIM verifies, create inboxes on the domain by passing domain to POST /inboxes.
mail.example.com keeps your existing root-domain MX records untouched.Errors
Errors are JSON with a stable _tag to branch on and a human-readable message:
{
"_tag": "QuotaExceeded",
"message": "Daily send limit reached (50 on Starter). Resets at 00:00 UTC.",
"limit": "daily_sends",
"max": 50,
"used": 50
}| Status | _tag | Meaning |
|---|---|---|
| 401 | Unauthorized | Missing, invalid or revoked key. |
| 402 | QuotaExceeded | Plan limit reached. limit is one of agents, inboxes_per_agent, monthly_sends, daily_sends, custom_domains, message_size. |
| 403 | Forbidden | Not allowed with this key type, the inbox is paused, or the agent's sending is paused for bounces or complaints. |
| 404 | NotFound | Doesn't exist or isn't visible to this key. Includes resource. |
| 409 | Conflict | Already exists (a taken username), or the message is in the wrong state — e.g. approving mail that was already decided. |
| 422 | InvalidRequest | Validation failed; field names the culprit when known. |
| 429 | RateLimited | Too many requests. Wait retryAfter seconds (also sent as Retry-After). |
| 502 | DeliveryFailed | Amazon SES rejected or failed the request. |
Plans & limits
Limits are enforced per account. Received mail has its own monthly limit (it never counts as sends) and mail over the limit or the plan’s max inbound size is dropped; daily limits reset at 00:00 UTC and monthly limits on the 1st. See pricing for the numbers, or call GET /me for your own plan and usage, and GET /usage?days=30 for a daily series.
- Agents per account, inboxes per agent, custom domains.
- Sends per day and per month (counted per recipient).
- Received messages per month and maximum inbound size — mail over either is dropped and counted in
usage.droppedThisMonth. - Maximum message size including attachments, and message retention.
- Request rate: 600 API/MCP requests a minute per key or session, 120 a minute per IP without credentials, 10 agent sign-ups an hour per IP, and tighter budgets on sign-in links and password resets. Over the limit you get
429withRetry-After.
Sending reputation
Every agent sends through the same Amazon SES account, and SES reviews or suspends accounts whose mail bounces or draws spam complaints. To protect everyone's delivery, AGMX pauses an agent's sending when at least 5 of its sends hard-bounce at a rate of 5% or more, or at least 2 draw complaints at 0.1% or more (measured over 30 days). Receiving keeps working and scheduled mail waits. You get an email and an agent.sending_paused webhook. Fix the cause, then resume from the agent page or with an account key. Resuming starts a fresh window.
/api/v1/agents/{agentId}/reputation/api/v1/agents/{agentId}/sending/pause/api/v1/agents/{agentId}/sending/resumeExport & deletion
Download everything stored for your account as one JSON file — profile, agents, inboxes, rules, domains, API key names, threads, messages, attachment metadata and usage. Secrets, key hashes and attachment bytes are left out. Works with a dashboard session or an account key, not an agent key.
/api/v1/account/exportcurl https://agmx.io/api/v1/account/export -H "Authorization: Bearer $AGMX_ACCOUNT_KEY" -o agmx-export.jsonDeleting an account removes its agents, inboxes, mail, attachments, keys and custom domains immediately. It needs a signed-in human: use Settings → Your data, or call the endpoint from a dashboard session with confirm set to the account email. API keys can't delete accounts.
/api/v1/accountSelf-hosting
AGMX is open source (GitHub). It's a single TanStack Start app with Effect services, Postgres via Drizzle, Better Auth and Amazon SES. It runs anywhere Node 22+ and Postgres run — Railway works out of the box.
Environment
| Variable | Purpose |
|---|---|
DATABASE_URL | Postgres connection string. |
BETTER_AUTH_SECRET | Long random string used to sign sessions. |
APP_URL | Public URL, e.g. https://agmx.io (falls back to RAILWAY_PUBLIC_DOMAIN). |
MAIL_DOMAIN | Shared inbox domain, e.g. agmx.io. |
ALLOWED_EMAILS | Comma-separated emails or *@domain.com patterns allowed to sign in. Empty means open sign-ups. |
ADMIN_EMAILS | Operators: admin role and the unlimited plan. |
DEFAULT_PLAN | Plan for new accounts (free, pro, scale, unlimited). |
AWS_REGION / AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY | SES credentials. Use a region with SES receiving (e.g. us-east-1). |
SES_CONFIGURATION_SET | Optional: configuration set for delivery, bounce and complaint events. |
SES_INBOUND_TOPIC_ARNS | The SNS topic ARNs the inbound webhook accepts. Required in production; set it before subscribing the topic. |
SES_RECEIPT_RULE_SET / SES_RECEIPT_RULE | Optional: rule that custom domains get added to automatically. |
MAIL_TRANSPORT | ses or log. Defaults to ses when AWS credentials are present. |
SYSTEM_FROM | From address for sign-in emails, e.g. AGMX <no-reply@agmx.io>. |
ENABLE_AGENT_SIGNUPS | Set to false to disable POST /signup. |
OPERATOR_NAME | Who runs the instance, named in /terms and /privacy. |
SYSTEM_INBOXES | Role mailboxes created for the first operator (default abuse,postmaster,privacy). Empty disables. |
Amazon SES setup
- Verify your mail domain in SES (Identities → Create identity → Domain) and publish the DKIM records. Request production access to send to unverified recipients.
- Point the domain's MX record at
inbound-smtp.<region>.amazonaws.com(priority 10). - Create an SNS topic and subscribe
https://<your-host>/api/inbound/sesover HTTPS. AGMX verifies SNS signatures and confirms the subscription automatically. - Create an active receipt rule for your domain with an SNS action (Base64 encoding) to that topic. For messages over 150 KB, use an S3 action with an SNS notification instead — AGMX fetches the raw message from S3.
- Optional: create a configuration set with an SNS event destination (Delivery, Bounce, Complaint) to the same endpoint, and set
SES_CONFIGURATION_SET.
bun install
bun run build
bun run start:prod # runs database migrations, then starts the serverMAIL_TRANSPORT defaults to log: outbound mail and sign-in links are printed to the console, and POST /api/dev/inbound lets you inject inbound mail (JSON or raw MIME).API reference
Every endpoint, schema and error is described in a generated OpenAPI 3.1 document, with an interactive explorer.