Guides

Inbound email

Receive mail through Cloudflare Email Routing, list what arrived, and fetch the raw MIME exactly as it was ingested.

emitd receives mail via Cloudflare Email Routing and stores it for you to read back over the API. The raw message is kept byte-for-byte in R2 and is never rewritten, so what you parse is what the sender sent.

List what arrived

curl "https://api.emitd.com/v1/inbound?limit=25" \
  -H "Authorization: Bearer $EMITD_API_KEY"

Newest first. The next_cursor is the bare epoch-millisecond created_at of the last row returned — pass it back as cursor for the next page, and stop when it is null.

curl "https://api.emitd.com/v1/inbound?limit=25&cursor=1759881600000" \
  -H "Authorization: Bearer $EMITD_API_KEY"

The address fields are named differently on each endpoint

The list returns from_addr / to_addr. The single-message GET below returns from / to. This trips people writing one shared parser for both — handle each shape explicitly rather than assuming the detail response is a superset of the summary.

Fetch one message

curl https://api.emitd.com/v1/inbound/$ID \
  -H "Authorization: Bearer $EMITD_API_KEY"

The detail response adds raw: the original MIME, exactly as ingested and never parsed. Parse it with whatever your language already has — email in Python, mail in Ruby, mailparser in Node. Don't write your own MIME parser for this.

raw is null when the R2 object is missing. The endpoint deliberately returns the metadata with a 200 rather than failing the whole request, so check for null before parsing — a missing body is not an error response, and code that assumes raw is a string will throw here rather than at a status check.

An unknown id returns 404.

Delivery events for mail you send are a different surface — see Webhooks and Message activity.

Full schemas: Inbound API.

On this page