Pods
What are Pods?
Pods are an isolated abstraction that sits between your organization and your inboxes, providing a method to segment and organize email infrastructure for multi-tenant applications. If you’re building a service that offers email functionality to your customers, pods are your key to ensure customer resource isolation.
The Hierarchy
Organization: Your company’s AgentMail account
- You have one organization that represents your business
Pod: Each of your customers
- Create one pod per customer/tenant in your system
- Pods provide complete isolation between your customers’ data
- All resources (inboxes, domains, threads, drafts) can be scoped to a pod
Inbox: Individual email accounts within a pod
- Your customers can have multiple inboxes within their pod
- It is on you to provision resources for each of your customers
Why Use Pods?
Multi-Tenancy
Pods enable you to offer AgentMail’s email infrastructure to your own customers while maintaining strict data isolation. Here’s how our customers use pods:
SaaS/Agency Platforms: Create a pod for each customer account. Each customer gets their own isolated email workspace.
White-Label Email: Offer email services under your own brand. Each end-user gets their own pod with complete data isolation.
AI Agent Platforms: Give each AI agent with its own purpose its own pod with dedicated inboxes and domains.
How Pods Work
Pod Lifecycle
As a basis, here are a couple of logistical stuff that happens on the API side when you create resources.
- When you sign up, you are automatically created a
Default Pod, and all resources created whether itsInboxesorDomainsall are associated with thisDefault Pod. - You cannot delete a
Podthat has existing children resources. Make sure to delete any existingInboxesorDomainsbefore deleting aPod.
What You Can Do With Pods
Creating Resources
You can create the following resources within a pod:
- Inboxes
- Domains
NOTE: as of now domains can only be either scoped to one pod, or all pods. I.E it is not possible to create a domain scoped to more than one but not all pods.
TIP: specify a client_id when creating a Pod so that you can decide how to
uniquely identify pods. That way you don’t need to create a table mapping your
organization_id’s for your customers or segment of your business to our
pod_id’s you can just set the client_id as your internal id so you can
access the resource using a unique identifier determined by you!
These resources are automatically associated with the pod and inherit its isolation guarantees.
Listing Resources
You can list the following resources scoped to a pod:
- Inboxes (
GET /pods/{pod_id}/inboxes) - View all inboxes in a pod - Threads (
GET /pods/{pod_id}/threads) - View all email conversations across all inboxes in the pod - Drafts (
GET /pods/{pod_id}/drafts) - View all draft emails across all inboxes in the pod - Domains (
GET /pods/{pod_id}/domains) - View all custom domains in the pod
This gives you a unified view of all activity within a customer’s workspace, making it easy to build features like:
- “Show me all unread emails for Customer X” (use labels here too!)
- “List all threads across all of Customer Y’s team inboxes”
- “Display all pending drafts for Customer Z”
Important Considerations
Pod Deletion Constraints
Critical: You cannot delete a pod that has resources still attached to it. You must delete all inboxes and domains within the pod before you can delete the pod itself.
This is a safety mechanism to prevent accidental data loss. Here’s the correct deletion sequence:
When you delete an inbox or domain, all associated data (messages, threads, drafts) is automatically cleaned up. You don’t need to manually delete individual threads or messages.
What’s NOT Isolated to a Pod:
- API keys (these are organization-level and can access any resources in any pod)
Common Patterns and Use Cases
Pattern 1: Multi-Tenant SaaS
Each company using your platform gets their own pod:
Pattern 2: Agency Client Management
Each client gets their own isolated pod:
Pattern 3: AI Agent Platform
Each AI agent gets its own pod with dedicated email infrastructure:
FAQ
Can inboxes communicate between pods?
Yes! Inboxes in different pods can send and receive emails from each other just like any other email addresses. Pods only provide organizational isolation, not network isolation.
Can I move an inbox from one pod to another?
No, inboxes cannot be moved between pods. You will need to create a new inbox in the pod you want.
How many pods can I create?
There’s no hard limit on the number of pods. You can create as many as you need for your customers.
Do I need to use pods?
Pods are optional but highly recommended for multi-tenant applications. If you’re only managing email for your own organization, you can work directly with inboxes without creating pods.
Can I set custom permissions per pod?
Pod isolation is upon the caller (you). As of now we don’t support pod-scoped API keys so it will be on you to make the calls to AgentMail.
