Inbox
API reference for receiving email: turn on receiving, manage addresses, list and read received email, and reply.
Receive email on your domain: turn on receiving, add addresses, then read, move and reply to what arrives. How it works is in Receive email. Receiving is free; replies count as one email each.
Turn on receiving#
For a verified domain. Returns the MX record to add and creates hello@. Check progress with GET /api/v1/domains/:name/receiving, which looks at DNS again while the status is pending.
Body
subdomainstringDefaultinbound→inbound.acme.com. An empty string uses the domain itself, only if nothing receives mail there.
{
"domain": "acme.com",
"host": "inbound.acme.com",
"status": "pending",
"records": [{ "type": "MX", "name": "inbound.acme.com", "value": "mx1.…", "priority": 10 }],
"error": null
}Addresses#
Body
addressstringrequiredOn create:[email protected]. Use*as the local part for a catch-all.namestringSender name on replies.webhook_urlstringhttps URL that gets each email. See webhooks.forward_tostringAlso forward each email to this address (one email from the plan each).rotate_secretbooleanOn update: replace the webhook signing secret.
curl https://maillayer.com/api/v1/inboxes \
-H "Authorization: Bearer $MAILLAYER_KEY" \
-H "Content-Type: application/json" \
-d '{ "address": "[email protected]", "webhook_url": "https://acme.com/hooks/email" }'{
"id": "9d2f…",
"object": "inbox",
"address": "[email protected]",
"local_part": "agent",
"host": "inbound.acme.com",
"receiving": "active",
"name": null,
"webhook_url": "https://acme.com/hooks/email",
"webhook_secret": "whsec_…",
"forward_to": null,
"created_at": "2026-11-26T10:00:00.000Z"
}Deleting an address deletes its email too.
List received email#
Newest first, without bodies. Spam is left out unless you ask for folder=spam. For the next page, pass before= the next_before value.
Query
inbox_idstringOnly this address.thread_idstringOnly this conversation.unreadbooleantruefor conversations not marked read.folderstringinbox,archivedorspam.sinceISO dateReceived after this time.beforeISO dateReceived before this time.limitnumber1–100, default 20.
{
"data": [
{
"id": "a41e…",
"object": "inbound_email",
"from": "[email protected]",
"subject": "Where is my order?",
"snippet": "Hi! Order 4512 hasn't arrived…",
"read": false,
"folder": "inbox",
…
}
],
"has_more": false,
"next_before": "2026-11-26T10:00:00.000Z"
}Get received email#
Everything, including text, html, authentication (SPF, DKIM, DMARC as checked by the mail server) and attachments with a download url that works for one hour. The fields are the same as in the webhook.
Mark or move#
Body
readbooleanMark the conversation read or unread.folderstringinbox,archivedorspam.
Reply#
Sends a reply from the address the email was sent to, in the same conversation, with the right threading headers. Same rules as any email: your plan, approval and suppressions apply. Returns the sent email with its thread_id.
Body
textstringPlain-text reply. Givetext,htmlor both.htmlstringHTML reply.
curl https://maillayer.com/api/v1/inbound/a41e…/reply \
-H "Authorization: Bearer $MAILLAYER_KEY" \
-H "Content-Type: application/json" \
-d '{ "text": "Hi Ada, it ships tomorrow. Sorry for the wait!" }'Get a conversation#
Every email in the conversation, oldest first: received ones have direction: "in", replies you sent have direction: "out" with their delivery status.