For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
    • Introduction
  • Getting Started
    • What is AgentMail?
    • What can I do with an inbox?
    • Creating your first inbox
    • Getting your API key
  • Agent Patterns
    • Handling inbound emails
    • Allowlists & blocklists
    • Managing threaded conversations
    • Human-in-the-loop workflows
    • Pods for multi-tenant email
    • Using labels to track state
  • Domains & Deliverability
    • Custom domain setup
    • SPF, DKIM, and DMARC setup
    • Emails going to spam
    • Warming Up
    • MX record conflicts
  • Troubleshooting
    • API 403 error
    • Rate limits
    • Preventing duplicate sends
    • Domain not verifying
    • Emails bouncing
    • Why are my emails not showing up?
  • DNS Guides
    • Cloudflare
    • GoDaddy
    • Route 53 (AWS)
    • Namecheap
LogoLogo
contact@agentmail.ccDiscord
On this page
  • Sending
  • Receiving
  • Threading and conversations
  • Organization and filtering
  • Identity and authentication
  • Access methods
  • Quick example
Getting Started

What can I do with an AgentMail inbox?

A complete overview of inbox capabilities for AI agents.
Was this page helpful?
Edit this page
Previous

How do I create my first inbox?

Get up and running with your first AgentMail inbox.
Next
Built with

An AgentMail inbox is a full email account for your AI agent. Each inbox gets a unique email address and can send, receive, reply, forward, and manage emails entirely through the API.

Sending

  • Send emails to anyone on the internet
  • CC and BCC AI agents in email threads
  • Forward emails to humans and AI agents
  • Create and send drafts
  • HTML and plain text
  • Attachments with Base64 encoding (PDFs, images, documents)
  • Custom display names
  • Labeling email threads
  • Schedule send emails for later

Receiving

  • Receive emails from anyone: your inbox has a real email address
  • Webhooks for real-time notifications when an email arrives
  • WebSockets for persistent event streaming without needing a public URL
  • Spam and virus detection on all incoming emails
  • Attachment downloads to programmatically access files from received emails
  • Reply extraction with built-in extracted_text and extracted_html fields that strip quoted text

Threading and conversations

  • Automatic threading: replies are grouped into conversation threads using standard email headers
  • Reply-to messages to maintain context in multi-turn conversations
  • Reply all to respond to all recipients on a thread
  • Forward messages to other addresses or agents
  • Org-wide thread listing to query conversations across every inbox in your organization

Organization and filtering

  • Labels: add custom string tags to messages (e.g., urgent, sales, needs-response)
  • Filter by label: list only messages or threads matching specific labels
  • Allowlists and blocklists: control who an inbox can send to and receive from
  • Pods: isolate groups of inboxes per customer for multi-tenant applications

Identity and authentication

  • Custom domains: send from your own domain (e.g., agent@yourcompany.com) instead of @agentmail.to
  • SPF, DKIM, and DMARC: full email authentication for production deliverability
  • Idempotent inbox creation: use the client_id parameter to safely create inboxes without duplicates

Access methods

  • REST API: full CRUD on inboxes, messages, threads, drafts, and attachments
  • Python SDK: pip install agentmail
  • TypeScript SDK: npm install agentmail
  • SMTP: connect email clients or existing systems for sending
  • MCP Server: use with Claude Code, Cursor, and other AI coding tools
  • IMAP: coming soon

Quick example

Python
1from agentmail import AgentMail
2
3client = AgentMail()
4
5# Create an inbox with a display name
6inbox = client.inboxes.create(display_name="Support Agent")
7
8# Send an email with a human CC'd
9client.inboxes.messages.send(
10 inbox_id=inbox.inbox_id,
11 to=["customer@example.com"],
12 cc=["manager@yourcompany.com"],
13 subject="Your support request #1234",
14 text="Hi! I've reviewed your request and here is what I found...",
15 html="<p>Hi! I've reviewed your request and here is what I found...</p>",
16 labels=["support", "tier-1"]
17)
18
19# Check for replies
20threads = client.inboxes.threads.list(inbox_id=inbox.inbox_id)
21
22if threads.threads:
23 # Get the full conversation
24 thread = client.threads.get(thread_id=threads.threads[0].thread_id)
25
26 # Reply to the latest message
27 client.inboxes.messages.reply(
28 inbox_id=inbox.inbox_id,
29 message_id=thread.messages[-1].message_id,
30 text="Following up: have you had a chance to try the fix?",
31 html="<p>Following up: have you had a chance to try the fix?</p>"
32 )