Inboxes

The foundation of your agent's identity and communication.

What is an Inbox?

People are used to the traditional Gmail limitations — only having one inbox. Thats of the past.

An Inbox is now a fully loaded, programmatically accessible API resource re-designed for the scale of AI Agents.

Think of it as being similar to a Gmail or Outlook account, but built API-first. Each Inbox has a unique email address and serves as the primary resource your agent uses to send and receive emails, giving it a first-class identity on the internet.

Unlike traditional email providers that are designed for human scale, AgentMail Inboxes are built to scale horizontally. You can create tens, hundreds, or even thousands of Inboxes for your agents on demand.

Pssstt! Rather then sending 1000 emails from 1 Inbox sending 10 emails across 100 Inboxes actually improves deliverability! Read more about optimizing for deliverability here

The AgentMail Hierarchy

As the diagram below illustrates, your organization is the top-level container that holds all your resources. You can provision many Inboxes within your organization, each with its own Threads, Messages, and Attachments, allowing you to manage a large fleet of agents seamlessly.

AgentMail Organizational Hierarchy
1

Organization

Your organization is the highest-level entity. It acts as a container for all your Inboxes, Domains, and API keys, allowing you to manage everything in one place.

2

Inbox

An Inbox is a single, scalable “email account” for your agent. You can create thousands of Inboxes within your organization, each with its own unique email address.

3

Thread

A Thread represents a single conversation. It groups together all replies and forwards related to an initial email, keeping your interactions organized.

4

Message

A Message is an individual email. It contains the content, sender, recipients, and any associated metadata or Attachments. You can cc humans at any point in time to keep a “human-in-the-loop”

5

Attachment

An Attachment is a file that is sent along with a Message. You can programmatically access and download attachments from incoming Messages.

Core Capabilities

Here at AgentMail we’ve now made an Inbox is an API resource, meaning you can perform standard CRUD operations on it. Here are the core capabilities you’ll use to manage your Inboxes.

1from agentmail import AgentMail
2
3# Initialize the client
4client = AgentMail(api_key="YOUR_API_KEY")
5
6# --- Create an Inbox ---
7# Creates a new inbox with a default agentmail.to domain
8new_inbox = client.inboxes.create()
9print(f"Created Inbox: {new_inbox.inbox_id}")
10
11# --- Retrieve an Inbox ---
12# Gets a specific inbox by its ID
13retrieved_inbox = client.inboxes.get(inbox_id = 'my_name@domain.com')
14print(f"Retrieved Inbox: {retrieved_inbox.inbox_id}")
15
16# --- List Inboxes ---
17# Lists all inboxes in your organization
18all_inboxes = client.inboxes.list()
19print(f"Total Inboxes: {len(all_inboxes)}")

When creating an Inbox, the username and domain are optional. If you don’t provide them, AgentMail will generate a unique address for you using our default domain. Check out our guide on managing domains to learn more.