Inbox

API reference for receiving email: turn on receiving, manage addresses, list and read received email, and reply.

Using an AI agent? Just ask:“Show me unread email to [email protected] and reply to the shipping questions.”Connect your agent →

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#

POST/api/v1/domains/:name/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

  • subdomainstring
    Default inbound → inbound.acme.com. An empty string uses the domain itself, only if nothing receives mail there.
Response · 201
{
  "domain": "acme.com",
  "host": "inbound.acme.com",
  "status": "pending",
  "records": [{ "type": "MX", "name": "inbound.acme.com", "value": "mx1.…", "priority": 10 }],
  "error": null
}

Addresses#

GET/api/v1/inboxes
POST/api/v1/inboxes
PATCH/api/v1/inboxes/:id
DELETE/api/v1/inboxes/:id

Body

  • addressstringrequired
    On create: [email protected]. Use * as the local part for a catch-all.
  • namestring
    Sender name on replies.
  • webhook_urlstring
    https URL that gets each email. See webhooks.
  • forward_tostring
    Also forward each email to this address (one email from the plan each).
  • rotate_secretboolean
    On update: replace the webhook signing secret.
Request
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" }'
Response · 201
{
  "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#

GET/api/v1/inbound

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_idstring
    Only this address.
  • thread_idstring
    Only this conversation.
  • unreadboolean
    true for conversations not marked read.
  • folderstring
    inbox, archived or spam.
  • sinceISO date
    Received after this time.
  • beforeISO date
    Received before this time.
  • limitnumber
    1–100, default 20.
Response · 200
{
  "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#

GET/api/v1/inbound/:id

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#

PATCH/api/v1/inbound/:id

Body

  • readboolean
    Mark the conversation read or unread.
  • folderstring
    inbox, archived or spam.

Reply#

POST/api/v1/inbound/:id/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

  • textstring
    Plain-text reply. Give text, html or both.
  • htmlstring
    HTML reply.
Request
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#

GET/api/v1/threads/:id

Every email in the conversation, oldest first: received ones have direction: "in", replies you sent have direction: "out" with their delivery status.