myagentmail API
Outreach infrastructure for AI agents. Email and LinkedIn, one API key, one SDK, one MCP server. Every endpoint on this page is callable today — paste your key below to verify.
Stripe-style browser auth. myagentmail login opens the dashboard, you click Approve, the key writes to ~/.config (mode 0600).
npm install -g myagentmail-cli myagentmail login
Plug into Claude Desktop, Cursor, or any MCP-compatible host.
npx -y myagentmail-mcp
Strongly typed client for Node and edge runtimes.
npm install myagentmail
Calls GET /v1/me and shows the identity we resolve from your key. Works with any prefix: tk_, wk_, ak_, sa_.
myagentmail is a multi-tenant email API for AI agents.
Create inboxes on the default @myagentmail.com domain or your own custom
domains, send and receive mail, manage drafts, subscribe to real-time
events over WebSocket, and isolate resources across workspaces so your
reseller customers can serve their own end-customers under a single
billing relationship.
Install the TypeScript SDK: npm install myagentmail
(npm)
MCP server for Claude Desktop / Cursor: npx -y myagentmail-mcp
(npm)
Authentication
Every request is authenticated with the X-API-Key header (or
Authorization: Bearer <key>). Four key prefixes, each with increasing
scope:
| Prefix | Scope | Use it for |
|---|---|---|
sa_... |
Super admin | Tenant lifecycle (platform operator) |
tk_... |
Tenant master | Everything in your tenant across workspaces |
wk_... |
Workspace master | One workspace only |
ak_... |
Inbox (agent) scoped | One inbox — its messages, drafts, lists |
Resource hierarchy
Tenant (billing root)
└── Workspace (isolation container)
├── Inboxes
│ ├── Messages / Threads / Attachments
│ ├── Drafts
│ └── Lists
└── Domains
Sending mail
Mail is sent via POST /v1/inboxes/{id}/send. Replies go through
/reply/{messageId}, reply-all through /reply-all/{messageId}, and
forwards through /forward/{messageId}. The From header always uses
the inbox's primary alias — add a custom-domain address with
POST /v1/inboxes/{id}/addresses to change it.
Receiving mail
Inbound mail arrives via SMTP on the default domain or any verified
custom domain. Subscribe to delivery events either by registering a
webhook (POST /v1/webhooks) or by opening a WebSocket
(wss://myagentmail.com/v1/ws) — useful for in-line 2FA flows where
the agent doesn't have a public webhook receiver.
Endpoints
103 endpoints across 17 groups. Each has its own page with request schema, response schema, and copy-pasteable code in TypeScript, Python, and curl.
Addresses
Multiple accepted addresses per inbox. Add a custom-domain alias to change the outbound From without losing thread history.
Cadences
- GET
/cadencesList cadences - POST
/cadencesCreate an outreach cadence - GET
/cadences/{id}Get a cadence with its steps - PATCH
/cadences/{id}Update cadence settings - DELETE
/cadences/{id}Delete a cadence - GET
/cadences/{id}/enrollmentsList enrollments for this cadence - POST
/cadences/{id}/enrollmentsEnroll a lead in this cadence - POST
/cadences/{id}/enrollments/bulk-relinkBatch-patch lead identity on multiple enrollments - POST
/cadences/{id}/run-nowForce a runner tick (debug) - PATCH
/cadences/{id}/stepsReplace the step list atomically - GET
/enrollments/{id}Get an enrollment + its step-run history - PATCH
/enrollments/{id}Update an enrollment (state, lead identity, scheduling)
Domains
Bring your own sending domain. Returns DNS records, verification state, and a BIND zone file export.
Drafts
Compose messages across multiple agent turns and send atomically.
Inboxes
Email mailboxes that can send, receive, and store threads.
LinkedIn — Outreach
Profile lookup, connection requests, keyword post search. Each call is logged and counted against a per-session daily quota (LinkedIn rate-limits per account, not per IP).
- GET
/linkedin/connectionsList 1st-degree connections - POST
/linkedin/connectionsSend connection request - GET
/linkedin/conversationsList inbox conversations - GET
/linkedin/conversations/{conversationUrn}/messagesRead messages in a conversation - GET
/linkedin/invitations/sentList pending sent invitations - POST
/linkedin/messagesSend a DM - POST
/linkedin/profiles/lookupResolve profile URL - POST
/linkedin/search/contentKeyword post search
LinkedIn — Posts
LinkedIn — Searches
Deterministic historical search across past-24h | past-week | past-month. Synchronous — returns the full hit list inline with the same structured output shape as signals (post + author + classification + cited reason). The plain-English firing rule filters to *exactly* what the buyer means; the keyword is a coarse pre-filter. Persisted server-side so the result set can be re-opened without spending another LinkedIn quota.
LinkedIn — Sessions
Login on behalf of the customer (email + password, with PIN or mobile-app verification challenge support), or import existing cookies. Cookies are AES-256-GCM encrypted at rest. Each session is tenant-scoped.
- GET
/linkedin/sessionsList sessions - POST
/linkedin/sessionsLogin (may challenge) - GET
/linkedin/sessions/{id}Get session metadata - DELETE
/linkedin/sessions/{id}Revoke session - POST
/linkedin/sessions/importImport existing cookies - POST
/linkedin/sessions/pollCollect mobile-app approval - GET
/linkedin/sessions/utilizationPer-session quota utilization - POST
/linkedin/sessions/verifySubmit PIN to complete a challenge
LinkedIn — Signals
Deterministic real-time intent watchers. Every signal is a keyword plus a plain-English firing rule (e.g. "Flag as ready when the author is a founder complaining about cold email — skip vendors and agencies"). Two-pass classifier: 1. Triage — text-only LLM scores each post 0–100; obvious rejects drop without paying any LinkedIn quota. 2. Verify — survivors get a profile lookup (cached, multi-session routed) and the full classifier runs with the author's role + company as authoritative context. The firing rule decides engage/intent, the reason cites evidence from the post. Sessions auto-distribute — by default polling spreads across all healthy LinkedIn sessions for the tenant, multiplying daily throughput by the number of connected accounts. Pass a specific sessionId on the create body to pin instead. Optional HMAC-signed webhook delivery with automatic retries. Auditable end-to-end.
- GET
/linkedin/signalsList signals - POST
/linkedin/signalsCreate a signal - GET
/linkedin/signals/{id}Fetch a signal - PATCH
/linkedin/signals/{id}Update a signal - DELETE
/linkedin/signals/{id}Delete a signal - GET
/linkedin/signals/{id}/deliveriesWebhook delivery log - GET
/linkedin/signals/{id}/matchesList matches for a signal - POST
/linkedin/signals/{id}/runRun a signal now - POST
/linkedin/signals/{id}/test-webhookSend a synthetic webhook payload - GET
/linkedin/signals/{id}/watchlistList watchlist entries - POST
/linkedin/signals/{id}/watchlistAdd watchlist entries - DELETE
/linkedin/signals/{id}/watchlist/{entryId}Remove a watchlist entry
Lists
Named groups of recipient addresses per inbox.
Messages
Send, reply, forward, list, and download messages.
- POST
/v1/inboxes/{id}/forward/{messageId}Forward a message - GET
/v1/inboxes/{id}/messagesList messages - GET
/v1/inboxes/{id}/messages/{messageId}Get a message - PATCH
/v1/inboxes/{id}/messages/{messageId}Update a message - DELETE
/v1/inboxes/{id}/messages/{messageId}Soft-delete a message - GET
/v1/inboxes/{id}/messages/{messageId}/attachmentsList attachments on a message - GET
/v1/inboxes/{id}/messages/{messageId}/attachments/{aid}Download an attachment - GET
/v1/inboxes/{id}/messages/{messageId}/rawDownload raw .eml source - POST
/v1/inboxes/{id}/reply-all/{messageId}Reply-all to a message - POST
/v1/inboxes/{id}/reply/{messageId}Reply to a message - POST
/v1/inboxes/{id}/sendSend a message - GET
/v1/inboxes/{id}/threadsList threads - GET
/v1/inboxes/{id}/threads/{threadId}Get a thread with all messages - POST
/v1/verify-emailCheck recipient deliverability
Metrics
Programmatic counters scoped by workspace or inbox.
Tenants
Super-admin only — platform operator endpoints.
Webhooks
HTTP callbacks fired on every inbox event.
WebSocket
Real-time event stream. The agentmail.to spec-compatible wire protocol.
Workspaces
Isolated containers under a tenant. Hand scoped keys to your resellers so their customers cannot see each other.
- GET
/v1/workspacesList workspaces - POST
/v1/workspacesCreate a workspace - GET
/v1/workspaces/{id}Get a workspace - DELETE
/v1/workspaces/{id}Delete a workspace - GET
/v1/workspaces/{id}/keysList workspace master keys - POST
/v1/workspaces/{id}/keysIssue a workspace master key - DELETE
/v1/workspaces/{id}/keys/{key_id}Revoke a workspace master key