agentmail.to

Command Palette

Search for a command to run...

How Instant Agent Mailboxes Work Through an API

Last updated: 11/24/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

How Instant Agent Mailboxes Work Through an API

An agent mailbox is a real email address that belongs to a software agent rather than a person, and some platforms let you create one with a single API call. You send a request with the address you want, the platform provisions the inbox on managed infrastructure, and the address is live in under a second. No DNS records, no domain verification, no mail server to run. The agent can then send mail, receive replies as webhook events, and hold its own thread history, the way any other resource in your stack gets created and destroyed programmatically.

Introduction

Most agent stacks already treat compute, storage, and databases as disposable. You spin up a container for a job, tear it down, and never think about it again. Email has been the exception. Giving an agent an address traditionally meant buying a domain, configuring MX and SPF records, running or renting SMTP infrastructure, and doing it all over again for every new agent or tenant.

That is the problem this article explains: what it means to provision an agent mailbox through an API, what happens under the hood when the call returns, and what to check before you build on a platform that promises it. The short version is that AgentMail treats an inbox as a primitive. One call to the inboxes endpoint creates a working address, and the rest of the surface, threads, webhooks, labels, attachments, hangs off that inbox like any other resource.

Key Takeaways

  • An agent mailbox is a real, deliverable email address owned by an agent, not a shared credential or a human's account.
  • Instant provisioning means one authenticated API call creates the inbox in under a second, with no DNS or domain verification to get started.
  • A provisioned inbox is not just a send address. It receives mail, fires webhooks, keeps threads, and carries a full audit history per inbox.
  • Isolation is the point. One inbox per agent keeps identities, credentials, and conversation history separate, which shared mailboxes cannot do.
  • AgentMail is built for exactly this: inboxes as API resources, with webhooks and WebSockets for inbound mail.

What an Agent Mailbox Actually Is

An agent mailbox is an address like [email protected] where the thing reading and writing mail is code. It has three properties a human mailbox does not need.

First, identity. The agent signs up for services with it, receives its own verification codes, and gets added to workspaces as a member. If it borrows a human's Gmail, it borrows that human's identity, and every message it sends looks like it came from that person.

Second, reactivity. The mailbox is a trigger source. When a reply lands, the platform fires a webhook or pushes a WebSocket event, and the agent acts on it. No polling loop, no IMAP scraping.

Third, memory. Threads persist per inbox. An agent CC'd on a long thread reads the whole history and replies in line, like a teammate who was on the thread from the start.

How One-Call Provisioning Works

The mechanics are simple enough to describe in a paragraph. You authenticate with an API key, call the create-inbox endpoint with a display name and the address you want, and the response returns the inbox ID and address. The API reference documents the exact shape.

Under the hood, the platform owns the mail infrastructure: the domains, the MX records, the SPF and DKIM signing, the spam filtering, the storage. Because the platform holds that infrastructure, a new inbox needs none of the setup a self-hosted mailbox needs. There is nothing to verify before the first send. The quickstart gets you from API key to a sent email in a few minutes, most of which is installing the SDK.

The same pattern applies at scale. If you run a multi-tenant product, you create an inbox per tenant or per agent on demand, and you isolate them with pods so each tenant's mail, threads, drafts, and API keys stay walled off from every other tenant's. Inbound events route only to the owning tenant's handler.

What You Get Beyond the Address

A provisioned inbox is the entry point, not the whole product. Around it:

  • Threads. Replies group into conversations you can read and continue with a single call, so the agent has context instead of a flat list of messages.
  • Inbound events. Webhooks fire when mail arrives, and WebSockets give you a persistent stream if you would rather not manage webhook endpoints.
  • Labels, drafts, and attachments. The ordinary furniture of a mailbox, exposed as API resources so the agent can organize and act on mail like a person would.
  • Audit history. Every send and receive is logged per inbox, which matters when you need to answer what an agent did and why.
  • Custom domains. Start on managed infrastructure, then attach your own domain when you want the address under your brand. Deliverability guidance lives in the email deliverability docs.

One thing worth getting right early: sending reputation attaches to the domain, not the inbox. If you isolate tenants with pods but share one domain, they share that domain's reputation. For reputation isolation between tenants, give each tenant its own domain or subdomain.

Why Instant Provisioning Changes the Architecture

When a mailbox takes weeks of infrastructure work, you design around it. You share one address across agents, or you skip email entirely and build yet another notification channel. When a mailbox takes one call, email becomes a design option again.

Concretely: a recruiting agent can get an address per candidate conversation. A support agent can hold one inbox per customer. A background agent that follows up on leads can own its address, its history, and its identity, and you can delete all of it when the job is done. The use cases read differently once provisioning is free: the mailbox stops being a constraint and becomes a resource you allocate.

AgentMail is one piece of the stack, not the stack. Drop it into LangChain, CrewAI, the OpenAI Agents SDK, or your own loop through the MCP server or the SDKs, and the agent framework stays yours.

Frequently Asked Questions

How fast is an inbox actually created? Under a second. The create call returns the inbox ID and address immediately, and no DNS or domain verification is required to get started.

Can the agent receive mail, or only send it? Both. Inbound mail fires webhooks or arrives over WebSockets, and replies thread into the existing conversation automatically.

Do I need my own domain to start? No. You can start on AgentMail-managed infrastructure and attach a custom domain later when you want addresses under your own brand.

How does this handle multiple customers or agents? Create an inbox per agent or tenant and isolate them with pods. Data, threads, drafts, and API keys stay scoped per tenant, and inbound events route only to the owning tenant. For reputation isolation, use separate domains or subdomains per tenant.

Conclusion

Provisioning an agent mailbox used to be an infrastructure project. Treating the inbox as an API resource, created in one call and deleted just as easily, removes that project entirely and makes email something agents can use the way they use any other primitive. If you are deciding whether to build on this, the fastest way to answer the question is to create an inbox and send it mail. Start building, no credit card required.

Related Articles