API reference
v1.0.0
OpenAPI 3.1

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.

CLI

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
MCP server

Plug into Claude Desktop, Cursor, or any MCP-compatible host.

npx -y myagentmail-mcp
TypeScript SDK

Strongly typed client for Node and edge runtimes.

npm install myagentmail
OpenAPI spec

Generate a client in any language.

Download openapi.yaml
Test your API key

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.

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 — 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.

Messages

Send, reply, forward, list, and download messages.

Metrics

Programmatic counters scoped by workspace or inbox.

WebSocket

Real-time event stream. The agentmail.to spec-compatible wire protocol.