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 agentsReceive-only email API for AI agents and automations
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.
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=..."] }claude mcp add --transport http restapi-email https://api.restapi.email/mcp \
--header "X-API-Key: sk_live_..."
# Then ask your agent to sign up somewhere. It calls:
list_messages { "address": "signup-bot@agent.restapi.email", "limit": 1 }
get_verification_code { "address": "signup-bot@agent.restapi.email",
"since": "<newest id from list_messages>" }
{ "code": "482913",
"link": "https://example.com/verify?token=...",
"message_id": "...", "subject": "Your code is 482913",
"from": "noreply@example.com" }{
"mcpServers": {
"restapi-email": {
"type": "http",
"url": "https://api.restapi.email/mcp",
"headers": { "X-API-Key": "sk_live_..." }
}
}
}For clients configured with an mcpServers block. Client-specific steps are on the MCP page.
Step 1
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.
Step 2
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.
Step 3
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.
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 agentsTreat 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 APISign 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 emailAgents 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_messagewait_for_message: long-poll for the next matchget_verification_code: wait, then return the code and linkdelete_messageclaude mcp add --transport http restapi-email https://api.restapi.email/mcp \
--header "X-API-Key: sk_live_..."since + wait=25 holds the request until a newer message arrives. One request against your rate limit, not a polling loop.
Likely one-time codes and verification links on every message and webhook, with Gmail, Outlook and Proofpoint redirects unwrapped.
Six tools at api.restapi.email/mcp, including get_verification_code. Works with Claude Code, Claude Desktop and Cursor.
HMAC-SHA256 over the raw body, HTTPS only, retried after 30s, 5m, 30m and 2h. Every attempt is logged.
Sender, envelope sender, subject, text, HTML, headers and raw MIME. Cursor pagination and full-text search.
sk_live_ keys can be limited to one inbox; agents get their own sk_agent_ key. Keys are stored hashed and shown once.
Server-rendered reference, Markdown, OpenAPI, llms.txt and agent.json, so a coding agent can integrate without a browser.
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.
Small, public, paid by card. Allowances are account-wide and shared across your inboxes; there are no overage charges.
Loading current plans…
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.
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.
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.
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.
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.
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.
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.
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.
Not today. Addresses are on agent.restapi.email, so there is no domain or DNS to configure.
Create an account, pick a plan, and read your first message with one authenticated request.
Receive-only. Paid plans, by card, cancel any time.