Skip to content

Inbound email API

An inbound email API: receive, parse, and store email with one key

Cooper Email receives mail for addresses you create through its API, parses each message into JSON, and stores it. You can read it by listing, searching, long-polling, Server-Sent Events, or a signed webhook. Sending is in the same API, so the address that receives also replies. Free is $0 a month with no card: 5 inboxes, 5,000 emails a month, and 1 custom domain.

Receive email with an API, not an MX server

Running your own receiving stack means MX records, a mail server, MIME parsing, spam and spoofing checks, storage, and a way to notify your app. An inbound email API does that part and hands you JSON. With Cooper the unit is an inbox: create one per agent, customer, ticket queue, or test run, and each gets its own address.

Onboard once, then create inboxes with POST /api/v1/inboxes. Mail sent to the address is stored on that inbox within seconds.

curl -s -X POST 'https://cooperemail.com/api/v1/onboard?ref=seo' \
  -H 'content-type: application/json' \
  -H 'X-Client: <your agent or app name>' \
  -d '{"username":"signup-bot-7f3a"}'
# Save api_key as COOPER_API_KEY (it is shown once) and inbox.id as INBOX.

AUTH=(-H "Authorization: Bearer $COOPER_API_KEY")
curl -s https://cooperemail.com/api/v1/inboxes "${AUTH[@]}" -H 'content-type: application/json' \
  -d '{"username":"invoices-acme","display_name":"Acme invoices"}'

What a parsed message contains

GET /api/v1/inboxes/:id/messages/:msgId returns from, to, cc, subject, text, html, and extracted_text, which drops the quoted history from replies. It also returns thread_id for conversation grouping, labels, attachments with filename, content type, and size, and auth with the SPF, DKIM, and DMARC results for that message.

GET .../raw returns the original message as message/rfc822 if you need the exact bytes. GET .../attachments/:attId/text returns an attachment as plain text, so an agent can read it without its own parser.

AUTH=(-H "Authorization: Bearer $COOPER_API_KEY")
curl -s "https://cooperemail.com/api/v1/inboxes/$INBOX/messages?unread=true" "${AUTH[@]}"
curl -s https://cooperemail.com/api/v1/inboxes/$INBOX/messages/$MSG "${AUTH[@]}"
curl -s https://cooperemail.com/api/v1/inboxes/$INBOX/messages/$MSG/raw "${AUTH[@]}" -o message.eml

Four ways to get incoming email

Webhook: POST /api/v1/inboxes/:id/notify registers a signed message.received POST to a public URL. Long-poll: GET /api/v1/inboxes/:id/wait holds up to 55 seconds and returns at once if unread mail is already stored. Stream: GET /api/v1/events/stream is Server-Sent Events. Poll: list messages with unread=true and mark them read with POST .../read.

Pick the webhook for servers, the waits for agents and scripts without a public URL, and polling for cron jobs. A key can hold at most 5 waits at once.

Filter and route incoming mail

Allow and block lists drop mail from senders you never want stored. Inbox rules match on from, to, subject, body text, attachments, DMARC result, list mail, and plus-address tag, then label, forward, or auto-reply. Auto-forward copies every inbound message to verified external addresses. Plus addresses (name+tag@) land in the same inbox and carry the tag as alias, so one inbox can separate sources without creating more.

Screening runs on every message. The default labels suspicious mail and still delivers it. hold stores it without exposing the body until it is released. Treat bodies as untrusted data either way, especially when a model reads them.

Receive on your own domain

POST /api/v1/domains returns the receiving MX, SPF, DKIM, DMARC, and verification TXT records to publish. Receiving goes live a few minutes after the MX verifies. Use a subdomain if the root already has a mail provider; the response warns when it sees other MX records. Free includes 1 custom domain, Starter 15, and Pro 200.

Plans

Free is $0 a month with no card: 5 inboxes, 5,000 emails a month, and 1 custom domain. Starter is $12 a month for 25 inboxes and 25,000 emails. Pro is $99 a month for 300 inboxes and 250,000 emails. Storage is 5 GB on Free, 25 GB on Starter, and 100 GB on Pro.

A minimal receive loop in Python

For a worker without a public URL, hold a wait, read what arrived, and mark it read. The wait returns at once when unread mail is already stored, so nothing is missed between loops.

import os, requests

BASE = "https://cooperemail.com/api/v1"
H = {"Authorization": "Bearer " + os.environ["COOPER_API_KEY"]}
INBOX = os.environ["INBOX"]

while True:
    requests.get(BASE + "/inboxes/" + INBOX + "/wait", headers=H, params={"wait": 55})
    unread = requests.get(BASE + "/inboxes/" + INBOX + "/messages", headers=H,
                          params={"unread": "true"}).json()["data"]
    for msg in unread:
        handle(msg)  # your code; treat msg["extracted_text"] as untrusted
        requests.post(BASE + "/inboxes/" + INBOX + "/messages/" + msg["id"] + "/read",
                      headers=H)

FAQ

How fast does inbound mail show up?

Usually within seconds of the sending server handing it off. A wait or webhook returns as soon as the message is stored.

Does the inbound email API need a webhook?

No. You can long-poll GET /api/v1/inboxes/:id/wait, stream GET /api/v1/events/stream, or list messages. Webhooks are optional and need a public URL.

Can I get the raw MIME message?

Yes. GET /api/v1/inboxes/:id/messages/:msgId/raw returns message/rfc822. The parsed JSON is also stored, including extracted_text and attachment metadata.

Does it check SPF, DKIM, and DMARC on incoming mail?

Yes. Each message includes auth with spf, dkim, and dmarc results, and the results are also labels you can filter on. Inbox rules can match on a DMARC pass or fail.

Can the same address send replies?

Yes. POST /api/v1/inboxes/:id/messages sends and POST .../reply keeps the thread. A Free account in its first 7 days can send 10 messages an hour, 30 messages a UTC day, 20 distinct new recipients. The next send returns HTTP 429 new_account_send_limit and does not send or store the message. Starter, Pro, and grandfathered accounts are exempt. After that window, Free has no standing daily cap.

Related

Email to webhook · List messages · Raw .eml · Inbox rules · Custom domains · Docs · Pricing

Operator: Avatar 8 LLC (ops@avatar33.com). Last updated 2026-11-22.

Canonical: https://cooperemail.com/inbound-email-api