NEW AI agents now first-class: authorize · audit · revoke in one click — your agents submit cleanly, bots stay blocked. Read agent docs →

Inbound email API: receive email over HTTP

Receive incoming email as structured JSON over HTTP — no IMAP, no mail server. Parse fields, extract codes and links, and fire a webhook on every message.

Most “email APIs” only send. The moment you need to receive — a reply, a verification code, an inbound support message — you’re told to run a mail server or poll IMAP and parse MIME by hand. An inbound email API removes all of that: it gives you a real receiving address and hands each incoming message to your code as structured JSON over HTTP.

What an inbound email API is

It’s three things behind one API: a real receiving address, delivery of incoming mail as JSON (or a signed webhook), and parsed fields so you never touch raw MIME. Where a sending API ends at “message queued,” an inbound API begins at “a message arrived — here it is, parsed.”

Receive in one call

Create a mailbox, then long-poll for the next message. wait blocks until mail arrives (or times out), so there’s no busy-polling:

# create an inbox
curl -X POST https://login.ollastack.com/api/mailboxes \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"inbound","mode":"agent","handle":"hello"}'
# → { "id":"mbx_…", "address":"hello@agent.ollastack.com" }

# receive the next message to it
curl "https://login.ollastack.com/api/mailboxes/mbx_.../wait?timeout=60" \
  -H "Authorization: Bearer $TOKEN"

The response is structured — your code reads fields, not envelopes. Ollastack also extracts one-time codes and URLs so you don’t regex the body:

{
  "from": "customer@example.com",
  "to": "hello@agent.ollastack.com",
  "subject": "Re: your quote",
  "text": "Sounds good — my code is 920184",
  "codes": ["920184"],
  "links": ["https://example.com/confirm?token=…"]
}

Inbound API vs forwarding / IMAP

Inbound email APIForwardingIMAP
DeliveryJSON / webhookraw relayyou poll
Parsingdone for younoneyou parse MIME
Codes & linksextracted
Setupan API tokenDNSmailbox creds

Forwarding moves mail; IMAP makes you do the work. An inbound API gives your application the message as data.

Webhook on inbound

Prefer push? Give the mailbox a webhook_url and every inbound message POSTs to it with an HMAC signature you verify, retried on failure. It’s the same structured payload as wait, delivered to your endpoint the instant mail lands. (For agents that act on inbound, see build an agent that sends and receives email.)

Where it fits

Inbound is the half that send-only APIs skip — and it’s the foundation for two-way conversations, agent inboxes, and CI email testing. It lives on the same API as sending: see the email API overview and the sibling email inbox API and free email API service guides.

Get an inbound address — receive mail as JSON, free to start, no credit card.

Frequently asked questions

What is an inbound email API?

An inbound email API gives you a real receiving address and hands incoming messages to your code as structured JSON over HTTP — the parsed from, subject, text and HTML bodies, attachments, and (with Ollastack) pre-extracted one-time codes and links. It replaces running your own mail server or scraping an IMAP mailbox.

How is an inbound email API different from forwarding or IMAP?

Forwarding just relays raw mail to another address; IMAP makes you connect, poll, and parse MIME yourself. An inbound email API delivers each message as clean JSON (or a signed webhook) the instant it arrives, so your app reads fields instead of parsing envelopes.

Can I get a webhook when email arrives?

Yes. Point a mailbox at a webhook URL and every inbound message POSTs to it (HMAC-signed, SSRF-guarded), or long-poll the wait endpoint to block until the next message lands. Both deliver the same structured payload.

Is there a free inbound email API?

Yes — Ollastack's free tier includes receiving and disposable test inboxes with no credit card. See the free tier on the email API page.

Last updated June 21, 2026. Spotted something out of date? Email hello@ollastack.com.