Switch from AgentMail to Cooper Email by changing the base URL: what the /v0 subset covers and what it does not
Cooper Email now answers a core subset of the AgentMail /v0 API at https://cooperemail.com: inbox create, list, get, rename and delete, message send,
If your agent already talks to AgentMail, the cheapest way to try Cooper Email is to keep your code and change one setting. As of December 3, 2026, Cooper serves a core subset of the AgentMail /v0 HTTP API on its own origin. Inboxes, messages, and threads use AgentMail's paths, field names, and error envelope. The rest of the AgentMail surface is not there, and this guide says which parts.
This is a migration guide, not a comparison. For the side-by-side on plans and features, see Cooper vs AgentMail and Cooper Email vs AgentMail, Resend, and Gmail. The reference for everything below is the AgentMail compatibility docs.
What changes
Three things:
- Base URL.
https://cooperemail.com. The SDK adds/v0/...itself, so do not append/v0. - API key. A Cooper key (it starts with
coop_live_), sent asAuthorization: Bearer./v0uses the same permission scopes as/api/v1. - Inbox addresses. New inboxes live at
@cooperemail.com(or your own domain on Cooper). Your existing AgentMail addresses and their mail stay at AgentMail. This is a switch for new inboxes, not an import.
inbox_id in a path can be the inbox email address, URL-encoded or not, or a Cooper inb_ id. Another account's inbox returns HTTP 404.
What the subset covers
| Area | Endpoints on Cooper |
|---|---|
| Inboxes | GET /v0/inboxes, POST /v0/inboxes, GET, PATCH, DELETE /v0/inboxes/{inbox_id} |
| Messages | POST /v0/inboxes/{inbox_id}/messages/send, GET .../messages, GET .../messages/{message_id}, POST .../messages/{message_id}/reply |
| Threads | GET /v0/inboxes/{inbox_id}/threads, GET .../threads/{thread_id} |
Send accepts to, cc, and bcc as a string or a list, plus reply_to, subject, text, html, labels, headers, and attachments (each with filename and base64 content). The response is message_id and thread_id. Reply accepts text, html, attachments, labels, and reply_all. Inbox create accepts username, domain, display_name, and client_id, and PATCH changes display_name. A repeated username or client_id returns the original inbox: HTTP 201 the first time, 200 on a replay.
Lists return count, limit, next_page_token, and the items. Message lists filter by limit, page_token, labels, before, after, ascending, from, to, and subject.
Send and reply call the same code as /api/v1. Plan limits, suppressions, the Idempotency-Key header, outbound safety checks, approval mode, and events behave exactly as they do on the native API.
What it does not cover
Be clear about this before you switch a production agent:
- Not on
/v0: pods, drafts, webhooks, domains, calendars, lists, metrics, and x402. Any other/v0path returns HTTP 404 with codenot_implemented_in_cooper_v0and adocslink. In our test, the SDK'swebhooks.list()got exactly that. - Attachment URLs are refused. An attachment with
urlreturns HTTP 400attachment_url_not_supported, because Cooper does not fetch remote files on your behalf. Send the bytes as base64 incontent. - Unknown fields are errors, not ignored. A body field or query parameter outside the subset returns HTTP 400
not_implemented_in_cooper_v0naming the field. For example, a customtoon reply is refused; reply goes to the sender (or everyone withreply_all). - Some values are Cooper's.
updated_atequalscreated_aton inboxes and messages, andsizeis computed from text, HTML, and attachment bytes rather than a stored RFC 822 size. Labels are Cooper's labels (a received message carriesunread,inbox, and authentication results such asdkim-pass), so filters on AgentMail-specific label names need a look. pod_idis null unless the Cooper account is a workspace.
If you depend on any of these, you have two honest options: keep that part on AgentMail, or port it to the native API at /api/v1, which has webhooks, custom domains, drafts and approval, search, and more. The OpenAPI file lists both.
Step 1: get a Cooper key
One request, no card:
curl -s -X POST 'https://cooperemail.com/api/v1/onboard' \
-H 'content-type: application/json' \
-d '{"username":"support-bot"}'
The response has api_key and your first inbox. Save the key as COOPER_API_KEY.
Step 2: point your client at Cooper
curl
# Create an inbox. inbox_id in the response is the address.
curl -s https://cooperemail.com/v0/inboxes \
-H "Authorization: Bearer $COOPER_API_KEY" \
-H 'content-type: application/json' \
-d '{"username":"helper","display_name":"Helper"}'
INBOX='helper@cooperemail.com'
# Send
curl -s "https://cooperemail.com/v0/inboxes/$INBOX/messages/send" \
-H "Authorization: Bearer $COOPER_API_KEY" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: welcome-ada-1' \
-d '{"to":"ada@example.com","subject":"Hello","text":"Sent through Cooper."}'
# List messages, then reply to one
curl -s "https://cooperemail.com/v0/inboxes/$INBOX/messages?limit=10" \
-H "Authorization: Bearer $COOPER_API_KEY"
curl -s "https://cooperemail.com/v0/inboxes/$INBOX/messages/$MESSAGE_ID/reply" \
-H "Authorization: Bearer $COOPER_API_KEY" \
-H 'content-type: application/json' \
-d '{"text":"Thanks, got it."}'
Python (agentmail SDK)
We ran this against production on December 3, 2026 with agentmail 2.0.26 from PyPI. The Python client has no base_url argument; it takes an environment, so build one with Cooper's origin. The REST calls only use http.
import os
from agentmail import AgentMail
from agentmail.environment import AgentMailEnvironment
from agentmail.inboxes.types import CreateInboxRequest
client = AgentMail(
api_key=os.environ["COOPER_API_KEY"],
environment=AgentMailEnvironment(
http="https://cooperemail.com",
websockets="wss://cooperemail.com", # not used by the /v0 subset
),
)
inbox = client.inboxes.create(
request=CreateInboxRequest(username="helper-py", display_name="Helper")
)
sent = client.inboxes.messages.send(
inbox.inbox_id, to="ada@example.com", subject="Hello", text="Sent through Cooper."
)
print(sent.message_id, sent.thread_id)
page = client.inboxes.messages.list(inbox.inbox_id, limit=10)
for m in page.messages:
print(m.message_id, m.subject, m.labels)
thread = client.inboxes.threads.get(inbox.inbox_id, sent.thread_id)
TypeScript (agentmail SDK)
Tested the same day with agentmail 0.5.54 from npm. The client options take baseUrl.
import { AgentMailClient } from "agentmail";
const client = new AgentMailClient({
baseUrl: "https://cooperemail.com",
apiKey: process.env.COOPER_API_KEY,
});
const inbox = await client.inboxes.create({ username: "helper-ts", displayName: "Helper" });
const sent = await client.inboxes.messages.send(inbox.inboxId, {
to: "ada@example.com",
subject: "Hello",
text: "Sent through Cooper.",
});
const page = await client.inboxes.messages.list(inbox.inboxId, { limit: 10 });
const first = page.messages[0];
if (first) {
await client.inboxes.messages.reply(inbox.inboxId, first.messageId, { text: "Thanks, got it." });
}
One thing we saw: on a non-workspace account, the TypeScript SDK logged response.pod_id: Expected string. Received null. when it validated the inbox response. The call still returned the inbox and the rest of the flow worked. The Python SDK did not complain.
Step 3: test the round trip
Use two Cooper inboxes so you can see both sides without touching real recipients:
- Create inbox A and inbox B with
POST /v0/inboxes. - Send from B to A's address. Keep the returned
thread_id. - Wait a few seconds, then list A's messages. The new message carries
unread,inbox,untrusted, and SPF, DKIM, and DMARC result labels. GETthat message on A and checkfrom,subject, andtext.- Reply from A. Then
GET /v0/inboxes/{B}/threads/{thread_id}. In our run, B's thread held two messages: the original send and the reply. Each inbox keeps its ownthread_idfor the conversation. - Try one negative case on purpose: an attachment with
url, which should return 400attachment_url_not_supported. - Delete both inboxes with
DELETE /v0/inboxes/{inbox_id}.
Errors use the AgentMail envelope {name, message, code, fix, docs}: 400 ValidationError (with errors), 401 UnauthorizedError, 403 ForbiddenError, 404 NotFoundError, 409 ConflictError, 429 RateLimitError. code is Cooper's code, so you can branch on the same values as /api/v1.
Webhooks and MCP
Webhooks are not in the /v0 subset, so an AgentMail webhook setup does not carry over by changing the URL. Register the hook on the native API instead: POST /api/v1/webhooks with url, events such as ["message.received"], and optionally inbox_id to scope it. Deliveries are signed with x-cooper-signature-v2, and the payload shape is Cooper's, so update the handler. The n8n webhook guide walks through verification. If the agent has no public URL, GET /api/v1/inboxes/{id}/wait or the events endpoint can long-poll instead.
If your agent runs in an MCP client, you may not need the SDK at all. Cooper's hosted MCP server is at https://cooperemail.com/mcp:
claude mcp add --transport http cooper-email https://cooperemail.com/mcp
Migration checklist
- List every AgentMail call your agent makes. Anything outside inboxes, messages, and threads goes to
/api/v1or stays on AgentMail. - Replace attachment
urlfields with base64content. - Remove fields Cooper refuses (custom reply
to, unknown inbox or query fields). - Set the base URL to
https://cooperemail.comand the key to a Cooper key. - Re-create webhooks on
/api/v1/webhooksand update the signature check. - Check label filters against Cooper's labels.
- Run the round trip above, then switch one agent before the rest.
- New Free accounts: during the first 7 days, sends are capped at 10 an hour, 30 a UTC day, and 20 distinct new recipients (HTTP 429
new_account_send_limit). Starter and Pro are exempt. See /limits.
What it costs
From the pricing page: Free is $0 with no card. New accounts get 3 inboxes and 3,000 emails a month, with webhooks, search, and MCP. Solo is $3 a month (10 inboxes, 10,000 emails), Starter is $12 (25 inboxes, 25,000 emails, 15 custom domains), and Pro is $99 (300 inboxes, 250,000 emails, 200 domains). Cooper does not have a SOC 2 report.
Next step
Run the onboard call in Step 1, set your client's base URL to https://cooperemail.com, and run the round trip. When you need more room, POST /api/v1/billing/checkout with {"plan":"starter"} returns a Stripe Checkout link, or connect your agent to https://cooperemail.com/mcp. Machine-readable docs are at https://cooperemail.com/llms.txt. Cooper Email is operated by Avatar 8 LLC. Questions: ops@avatar33.com.
Originally published on Cooper Email.
About the author
- Real email inboxes for AI agents, via API and MCP. By Avatar 8 LLC.
Comments
Join the discussionNo comments yet. Be the first to comment.