AgentMail
Give agents their own AgentMail inboxes to send, receive, reply to and forward email, with threads, drafts, labels and event webhooks. Connect with an AgentMail API key.
- rest
https://api.superagnt.com/v1/connections/agentmailplus the vendor's own path, with your superagnt_ API key asAuthorization: Bearer.- mcp
- Tools named
connection_agentmail_*onhttps://mcp.superagnt.com/mcp, served once the account is connected. - billing
- AgentMail bills your own account. Calls cost no superagnt_ data credits.
- rate limit
- 10 requests a second, 600 a minute: the vendor's ceiling as the registry records it, for sizing bursts. Your plan's own limit is on Connections.
- vendor docs
- https://docs.agentmail.to
The AgentMail connection gives an agent email inboxes of its own. It creates inboxes, sends new messages, replies and forwards, reads threads and messages with their attachments, saves drafts to send now or at a set time, labels threads and messages, counts message events, and registers webhooks that push new mail and delivery events to a URL.
01
Setup
- Create an API key. In your AgentMail dashboard, create an API key. AgentMail bills usage to that account directly.
- Connect AgentMail. In the superagnt app open Integrations, pick AgentMail, paste the key and press Connect.
02
Things to know
- Create an inbox with
connection_agentmail_inboxes_writeactioncreate. Leave outusernameand AgentMail picks a random one.domaindefaults toagentmail.to, and any other domain must be verified in AgentMail first. The message, thread and draft tools take theinbox_idthe call returns. get_organizationshows the organization's inbox and domain limits and how many of each are in use.- Lists page with
limitandpage_token. Message, thread and draft lists also filter bylabelsandbeforeoraftertimestamps. To see spam, blocked, unauthenticated or trashed messages, passinclude_spam,include_blocked,include_unauthenticatedorinclude_trash. - Attachments and a message's raw
.emlsource come back as expiring download URLs, not as file content. batch_get_messagesreturns the metadata, without bodies, of up to 500 messages in one call.- System labels (sent, received, bounced and the like) cannot be added or removed, and
update_threadrejects a thread with 100 or more messages. delete_threadmoves a thread to trash. A thread already in trash, or one deleted withpermanent=true, is gone for good.- A draft saved with
send_atis sent by AgentMail at that time, with no further call. - Sending a message, a reply, a reply-all, a forward or a draft, and every delete, always ask a person first by default. Everything else runs without asking, saving a draft with
send_atincluded: see Permissions. - The connection does not cover AgentMail account administration: API keys, domains and pods stay managed in AgentMail.
Webhooks
connection_agentmail_webhooks_writeactioncreateposts theevent_typesyou pick to yoururl:message.received(and its.spam,.blockedand.unauthenticatedvariants),message.sent,message.delivered,message.bounced,message.complained,message.rejectedanddomain.verified.- A webhook can be scoped to up to 10
inbox_idsand up to 10pod_ids. - Point it at a superagnt_ inbound webhook endpoint to start an agent when mail arrives. AgentMail signs each delivery with the webhook's
secret, which an inbound endpoint does not check, so leave the endpoint's signature verification off and keep its URL secret. - Without a webhook, poll
list_messageswithafterset to the time of your last check.
03
Examples
Create an inbox
curl -X POST "https://api.superagnt.com/v1/connections/agentmail/v0/inboxes" \
-H "Authorization: Bearer $AGNTDATA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "support-agent", "display_name": "Support Agent"}'Send a message
curl -X POST "https://api.superagnt.com/v1/connections/agentmail/v0/inboxes/<inbox_id>/messages/send" \
-H "Authorization: Bearer $AGNTDATA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "jenny.rosen@example.com",
"subject": "Your order has shipped",
"text": "Hi Jenny, your order left our warehouse today."
}'Push new mail to an agent
curl -X POST "https://api.superagnt.com/v1/connections/agentmail/v0/webhooks" \
-H "Authorization: Bearer $AGNTDATA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.superagnt.com/webhooks/ingest/<endpoint id>",
"event_types": ["message.received"]
}'17 tools, one per resource and risk
MCP servers and agents on the grouped surface list AgentMail as these tools. Each takes an action, and the ones that work across record types an object. Every operation also keeps its own per-operation name, in the next table, which works on every server. How grouping works: Grouped tools.
| Tool | Risk | Actions |
|---|---|---|
connection_agentmail_inboxes_readRead AgentMail inboxes List or get the organization's inboxes, or read an inbox's label-change events. Lists page with limit and page_token. | read | listgetlist_events |
connection_agentmail_inboxes_writeCreate and update AgentMail inboxes Create an inbox or change its display name. | write | createupdate |
connection_agentmail_inboxes_deleteDelete an AgentMail inbox Delete an inbox for good. Cannot be undone. | destructive | delete |
connection_agentmail_organization_readRead AgentMail usage Read the organization's limits and usage, or count message events (sent, delivered, bounced, delayed, rejected, complained, received) over a time range. | read | getquery_metrics |
connection_agentmail_webhooks_readRead AgentMail webhooks List or get the organization's webhooks. | read | listget |
connection_agentmail_webhooks_writeCreate and update AgentMail webhooks Create a webhook for message and domain events, or change the inboxes, pods and event types it covers. | write | createupdate |
connection_agentmail_webhooks_deleteDelete an AgentMail webhook Delete a webhook for good. | destructive | delete |
connection_agentmail_threads_readRead AgentMail threads List an inbox's threads, get one with all its messages, or get a download link for an attachment in a thread. Lists filter by labels and before/after timestamps and page with limit and page_token. | read | listgetget_attachment |
connection_agentmail_threads_writeLabel AgentMail threads Add or remove labels on a thread. System labels (sent, received, bounced and the like) cannot be changed, and threads with 100 or more messages are rejected. | write | update_labels |
connection_agentmail_threads_deleteDelete an AgentMail thread Move a thread to trash; a thread already in trash, or deleted with permanent: true, is deleted for good. | destructive | delete |
connection_agentmail_messages_readRead AgentMail messages List and read an inbox's messages, fetch the metadata of up to 500 messages at once, or get a download link for a message's raw source or an attachment. Lists filter by labels and before/after timestamps and page with limit and page_token. | read | listgetbatch_getget_rawget_attachment |
connection_agentmail_messages_sendSend AgentMail email Send a new message from an inbox, reply or reply to all, forward a message, or send a saved draft. Each one delivers real email to its recipients and cannot be recalled. | write | sendreplyreply_allforwardsend_draft |
connection_agentmail_messages_writeLabel AgentMail messages Add or remove labels on a message, such as read and unread. | write | update_labels |
connection_agentmail_messages_deleteDelete an AgentMail message Delete a message for good. Cannot be undone. | destructive | delete |
connection_agentmail_drafts_readRead AgentMail drafts List or get an inbox's drafts, or get a download link for an attachment of a draft. | read | listgetget_attachment |
connection_agentmail_drafts_writeWrite AgentMail drafts Save or edit a draft in an inbox. A draft with send_at is sent on its own at that time; connection_agentmail_messages_send sends one now. | write | createupdate |
connection_agentmail_drafts_deleteDelete an AgentMail draft Delete a draft for good. | destructive | delete |
All 36 operations
Each operation is a REST path under https://api.superagnt.com/v1/connections/agentmail and an MCP tool. The per-operation tool name is the one permissions, approvals and usage records use.
| Operation | MCP tool |
|---|---|
GET /v0/inboxesList Inboxes | connection_agentmail_list_inboxesgrouped: connection_agentmail_inboxes_read, action list |
POST /v0/inboxesCreate Inbox | connection_agentmail_create_inboxgrouped: connection_agentmail_inboxes_write, action create |
GET /v0/inboxes/{inbox_id}Get Inbox | connection_agentmail_get_inboxgrouped: connection_agentmail_inboxes_read, action get |
PATCH /v0/inboxes/{inbox_id}Update Inbox | connection_agentmail_update_inboxgrouped: connection_agentmail_inboxes_write, action update |
DELETE /v0/inboxes/{inbox_id}Delete Inbox | connection_agentmail_delete_inboxgrouped: connection_agentmail_inboxes_delete, action delete |
GET /v0/inboxes/{inbox_id}/draftsList Drafts | connection_agentmail_list_draftsgrouped: connection_agentmail_drafts_read, action list |
POST /v0/inboxes/{inbox_id}/draftsCreate Draft | connection_agentmail_create_draftgrouped: connection_agentmail_drafts_write, action create |
GET /v0/inboxes/{inbox_id}/drafts/{draft_id}Get Draft | connection_agentmail_get_draftgrouped: connection_agentmail_drafts_read, action get |
PATCH /v0/inboxes/{inbox_id}/drafts/{draft_id}Update Draft | connection_agentmail_update_draftgrouped: connection_agentmail_drafts_write, action update |
DELETE /v0/inboxes/{inbox_id}/drafts/{draft_id}Delete Draft | connection_agentmail_delete_draftgrouped: connection_agentmail_drafts_delete, action delete |
GET /v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}Get Attachment | connection_agentmail_get_draft_attachmentgrouped: connection_agentmail_drafts_read, action get_attachment |
POST /v0/inboxes/{inbox_id}/drafts/{draft_id}/sendSend Draft | connection_agentmail_send_draftgrouped: connection_agentmail_messages_send, action send_draft |
GET /v0/inboxes/{inbox_id}/eventsList Inbox Events | connection_agentmail_list_inbox_eventsgrouped: connection_agentmail_inboxes_read, action list_events |
GET /v0/inboxes/{inbox_id}/messagesList Messages | connection_agentmail_list_messagesgrouped: connection_agentmail_messages_read, action list |
POST /v0/inboxes/{inbox_id}/messages/batch-getBatch Get Messages | connection_agentmail_batch_get_messagesgrouped: connection_agentmail_messages_read, action batch_get |
POST /v0/inboxes/{inbox_id}/messages/sendSend Message | connection_agentmail_send_messagegrouped: connection_agentmail_messages_send, action send |
GET /v0/inboxes/{inbox_id}/messages/{message_id}Get Message | connection_agentmail_get_messagegrouped: connection_agentmail_messages_read, action get |
PATCH /v0/inboxes/{inbox_id}/messages/{message_id}Update Message | connection_agentmail_update_messagegrouped: connection_agentmail_messages_write, action update_labels |
DELETE /v0/inboxes/{inbox_id}/messages/{message_id}Delete Message | connection_agentmail_delete_messagegrouped: connection_agentmail_messages_delete, action delete |
GET /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}Get Attachment | connection_agentmail_get_message_attachmentgrouped: connection_agentmail_messages_read, action get_attachment |
POST /v0/inboxes/{inbox_id}/messages/{message_id}/forwardForward Message | connection_agentmail_forward_messagegrouped: connection_agentmail_messages_send, action forward |
GET /v0/inboxes/{inbox_id}/messages/{message_id}/rawGet Raw Message | connection_agentmail_get_raw_messagegrouped: connection_agentmail_messages_read, action get_raw |
POST /v0/inboxes/{inbox_id}/messages/{message_id}/replyReply To Message | connection_agentmail_reply_to_messagegrouped: connection_agentmail_messages_send, action reply |
POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply-allReply All Message | connection_agentmail_reply_all_messagegrouped: connection_agentmail_messages_send, action reply_all |
GET /v0/inboxes/{inbox_id}/threadsList Threads | connection_agentmail_list_threadsgrouped: connection_agentmail_threads_read, action list |
GET /v0/inboxes/{inbox_id}/threads/{thread_id}Get Thread | connection_agentmail_get_threadgrouped: connection_agentmail_threads_read, action get |
PATCH /v0/inboxes/{inbox_id}/threads/{thread_id}Update Thread | connection_agentmail_update_threadgrouped: connection_agentmail_threads_write, action update_labels |
DELETE /v0/inboxes/{inbox_id}/threads/{thread_id}Delete Thread | connection_agentmail_delete_threadgrouped: connection_agentmail_threads_delete, action delete |
GET /v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}Get Attachment | connection_agentmail_get_thread_attachmentgrouped: connection_agentmail_threads_read, action get_attachment |
GET /v0/metricsQuery Metrics | connection_agentmail_query_metricsgrouped: connection_agentmail_organization_read, action query_metrics |
GET /v0/organizationsGet Organization | connection_agentmail_get_organizationgrouped: connection_agentmail_organization_read, action get |
GET /v0/webhooksList Webhooks | connection_agentmail_list_webhooksgrouped: connection_agentmail_webhooks_read, action list |
POST /v0/webhooksCreate Webhook | connection_agentmail_create_webhookgrouped: connection_agentmail_webhooks_write, action create |
GET /v0/webhooks/{webhook_id}Get Webhook | connection_agentmail_get_webhookgrouped: connection_agentmail_webhooks_read, action get |
PATCH /v0/webhooks/{webhook_id}Update Webhook | connection_agentmail_update_webhookgrouped: connection_agentmail_webhooks_write, action update |
DELETE /v0/webhooks/{webhook_id}Delete Webhook | connection_agentmail_delete_webhookgrouped: connection_agentmail_webhooks_delete, action delete |