Skip to content

Receive-only email API for AI agents and automations

Give your AI agent an inbox. Read the verification code in one tool call.

Your agent signs up somewhere, waits for the email and gets the one-time code and verify link as JSON: one long-poll and one read over REST, or a single get_verification_code call over MCP. No mailbox, no IMAP, no mail server.

Receive-only: it does not send mail. Paid plans, by card. 30-day retention.

curl
API=https://api.restapi.email
INBOX=signup-bot@agent.restapi.email
KEY=sk_agent_...   # or an sk_live_ key

# 1. Before triggering the sign-up, note the newest message id
LAST=$(curl -s "$API/api/v1/emails/$INBOX/messages?limit=1" \
  -H "X-API-Key: $KEY" | jq -r '.emails[0].id // empty')

# 2. Wait up to 25 seconds for the next email (empty list on timeout: loop)
ID=$(curl -s "$API/api/v1/emails/$INBOX/messages?since=${LAST:-1970-01-01T00:00:00Z}&wait=25" \
  -H "X-API-Key: $KEY" | jq -r '.emails[0].id')

# 3. Read the code and the verification link
curl -s "$API/api/v1/emails/$INBOX/messages/$ID" \
  -H "X-API-Key: $KEY" | jq '.email.extracted'

{ "codes": ["482913"], "links": ["https://example.com/verify?token=..."] }

How it works

  1. Step 1

    Get an address

    Pick a plan and create an inbox at name@agent.restapi.email, plus an API key. No domain, no DNS, no mail server. An agent can also request its own inbox and send you the checkout link.

  2. Step 2

    Let mail arrive

    Use the address wherever your agent signs up or your system sends mail. Each message is parsed into sender, subject, text, HTML and headers, with one-time codes and links pulled out.

  3. Step 3

    Read it, or be told

    Long-poll the REST API until the next message lands, call the MCP tools from your agent, or have every message POSTed to your endpoint with an HMAC signature.

What people use it for

Agent sign-ups and OTP

Your agent registers for a service, waits for the confirmation email and reads the code or the verify link from extracted.codes and extracted.links. No human copying codes out of a mailbox.

Email verification for agents

Inbound automation with webhooks

Treat email as a trigger. A forwarded invoice, a form reply, a report or an instruction to your agent arrives at your endpoint as signed JSON, ready for your own code.

Inbound email API

Email tests in CI

Sign up in an end-to-end test with a real address, wait for the email your app sends, and assert on its subject, body or link. The same long-poll works from Playwright, Vitest or a shell script.

Testing your app’s email

An MCP server, not just an API

Agents that use tools can read email directly. Add the remote MCP server at https://api.restapi.email/mcp with the same API key you use for REST, and the agent gets:

  • list_inboxes, list_messages, get_message
  • wait_for_message: long-poll for the next match
  • get_verification_code: wait, then return the code and link
  • delete_message
Setup for Claude Code, Claude Desktop and Cursor
claude mcp add --transport http restapi-email https://api.restapi.email/mcp \
  --header "X-API-Key: sk_live_..."

What you get

Long-poll for new mail

since + wait=25 holds the request until a newer message arrives. One request against your rate limit, not a polling loop.

Codes and links extracted

Likely one-time codes and verification links on every message and webhook, with Gmail, Outlook and Proofpoint redirects unwrapped.

Remote MCP server

Six tools at api.restapi.email/mcp, including get_verification_code. Works with Claude Code, Claude Desktop and Cursor.

Signed webhooks

HMAC-SHA256 over the raw body, HTTPS only, retried after 30s, 5m, 30m and 2h. Every attempt is logged.

Full message as JSON

Sender, envelope sender, subject, text, HTML, headers and raw MIME. Cursor pagination and full-text search.

Scoped API keys

sk_live_ keys can be limited to one inbox; agents get their own sk_agent_ key. Keys are stored hashed and shown once.

Docs agents can read

Server-rendered reference, Markdown, OpenAPI, llms.txt and agent.json, so a coding agent can integrate without a browser.

30-day retention

Messages and raw MIME are deleted after 30 days, or earlier with one DELETE. Attachments are discarded, never stored.

What it does not do: send email, custom domains, or keep attachments. Messages over 1 MB are rejected.

Pricing

Small, public, paid by card. Allowances are account-wide and shared across your inboxes; there are no overage charges.

Loading current plans…

Compare plans and annual billing

Questions

Can RESTAPI.email send email?

No. It is receive-only. Mail sent to your address is stored and handed to you over the REST API, the MCP server or a signed webhook; nothing is sent on your behalf. Pair it with whatever you already use to send.

How long are messages kept?

Messages and their raw MIME are kept for 30 days and then deleted. You can delete a message earlier from the dashboard, with DELETE on the message API, or with the delete_message MCP tool; its content and stored mail go at once.

What happens to attachments?

File attachments are discarded before the message is stored. Inline images stay in the HTML body. Messages larger than 1 MB are rejected at delivery.

How does my agent wait for a verification email?

Note the newest message id, trigger the sign-up, then call the message list with since set to that id and wait=25. The request is held until a newer message arrives, or returns an empty list after 25 seconds so you can call again. Over MCP, get_verification_code does the waiting and returns the code and link.

How are codes and links extracted?

Each message carries extracted.codes (likely one-time codes, best first, at most 5) and extracted.links (verification-looking links first, at most 20). Links wrapped by Gmail, Outlook Safe Links or Proofpoint are unwrapped to their destination; unsubscribe and tracking-pixel links are left out. It is a heuristic, so the full text and HTML are always there too.

How do I know a webhook really came from you?

Every delivery is signed: X-Restapi-Email-Signature is sha256= followed by the hex HMAC-SHA256 of the raw body, keyed with the secret shown once when you create the webhook. Only https:// endpoints are accepted, and redirects are followed for at most three hops, each re-checked. A failed delivery is retried after 30 seconds, 5 minutes, 30 minutes and 2 hours.

Who can read my inbox?

Only requests carrying an API key for your account. Keys are stored as hashes, shown once and can be revoked; an sk_live_ key can be limited to a single inbox. Authenticated reads are limited to about 120 requests a minute per key.

Is there a free plan or a trial?

No. Every plan is paid, by card, and can be cancelled any time; cancelling keeps the service until the end of the period you paid for. Current prices are on the pricing page, read live from the billing system.

Can I use my own domain?

Not today. Addresses are on agent.restapi.email, so there is no domain or DNS to configure.

Give your agent an inbox this afternoon

Create an account, pick a plan, and read your first message with one authenticated request.

Receive-only. Paid plans, by card, cancel any time.