Skip to content
AI Inbx
Esc
navigateopen⌘Jpreview
On this page

email.received

Inbound mail arrived and was matched onto a thread.

Inbound mail. The one most applications are built around — it fires once per received message, with the thread it belongs to already resolved.

Payload

PropType
email_idstring

eml_… — retrieve it for bodies and headers.

Typestring
thread_idstring

The conversation it belongs to.

Typestring
domain_idstring | null

The domain it was received on, or null when it came through a mailbox.

Typestring | null
mailbox_idstring | null

The mailbox it was synced from, or null when it came in on a domain.

Typestring | null
fromstring

Sender address.

Typestring
tostring[]

Recipients on the envelope.

Typestring[]
subjectstring

The subject line.

Typestring
snippetstring

A short preview of the body.

Typestring
categorystring | null

human, out_of_office, auto_reply, bounce, verification, transactional, notification, marketing, or spam.

Typestring | null
verdicts?object

Sender authentication results: spam, spf, dkim, dmarc.

Typeobject
attachments?object[]

id, filename, content_type, size, preparation — metadata only.

Typeobject[]
{
  "id": "evt_...",
  "type": "email.received",
  "created_at": "2026-09-01T10:31:04Z",
  "space_id": null,
  "data": {
    "email_id": "eml_...",
    "thread_id": "thr_...",
    "domain_id": "dom_...",
    "mailbox_id": null,
    "from": "grace@example.com",
    "to": ["support@yourapp.com"],
    "subject": "Re: Quick question",
    "snippet": "Thursday at 10 works for me…",
    "category": "human",
    "verdicts": { "spam": "PASS", "spf": "PASS", "dkim": "PASS", "dmarc": "PASS" },
    "attachments": []
  }
}

Handling it

The payload carries a snippet, not the body — fetch the email when you need the full content.

if (event.type === "email.received" && event.data.category === "human") {
  const email = await aiinbx.emails.retrieve(event.data.email_id)
  await queueReply(event.data.thread_id, email.text)
}

Receiving

Getting mail to arrive in the first place — a domain’s MX record, or a connected mailbox.

Last updated on September 9, 2026

Was this page helpful?