Receiving email

api.email can receive email for your domain and deliver each message to your app as a signed JSON webhook. Receiving is included on every plan and counts like any other email.

Add an MX record

Point the domain that should receive mail at mx.api.email. Use a subdomain such as in.acme.com if your main domain already has mailboxes, so your team’s email is not redirected.

in.acme.com.   MX   10   mx.api.email.

Create a route

A route matches recipient addresses and forwards matching messages to a URL.

curl https://api.email/v1/routes \
  -H "Authorization: Bearer $API_EMAIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"match": "[email protected]", "forward": "https://acme.com/hooks/inbound"}'

The response is {"id": "rt_…", "secret": "whsec_…"}. Every delivery from the route is signed with that secret in the api-email-signature header, exactly like webhooks, so verify it before trusting the body. match takes an exact address or a catch-all such as *@in.acme.com. When several routes match, the exact address wins over the catch-all. Messages that match no route are rejected during the SMTP session, so senders get an immediate bounce instead of silence.

The payload

Each message arrives as an email.received event:

Field Description
id Unique event id, such as in_5d1e7a. Use it to deduplicate.
from, to Sender and the receiving address.
subject, text, html The full message.
reply_text Only the new part of a reply, without the quoted thread or signature.
in_reply_to The id of the email you sent through api.email, when the message replies to it.
headers All message headers, lower-cased.
attachments [{filename, content_type, size, url}]; download each url with your API key.
auth SPF, DKIM and DMARC results for the sender’s domain.
received_at ISO 8601 timestamp.

Replies and threading

When someone replies to an email you sent, in_reply_to contains its id, so you can attach the reply to the right ticket or comment without parsing subjects. For reply addresses that carry your own ids, use a catch-all route and addresses such as [email protected].

Limits

Messages up to 10 MB are accepted. Attachments are stored for 7 days for download; copy them to your own storage if you need them longer.

Get API key

Create your api.email account

What do you need?

Early access: accounts open in batches. By continuing you agree to the Terms and Privacy Policy.