> ## Documentation Index
> Fetch the complete documentation index at: https://nuntly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Receiving overview

> Learn how to receive emails on your verified domains. Understand the processing pipeline, key concepts, and common patterns for support inboxes, AI agents, multi-tenant SaaS, and email automation.

Nuntly can receive emails on your verified domains, not just send them. This gives your application a real email address it can read from, respond to, and build workflows around — without running an SMTP server or an IMAP client.

Incoming messages are security-checked, parsed, stored, and threaded into conversations. Your application gets notified in real time via webhooks and can read, reply, or forward messages through the API.

## How the pipeline works

When someone sends an email to an address on your domain, Nuntly processes it through a series of stages:

<Steps>
  <Step title="Receive">
    The email arrives at your domain. Virus-infected emails are rejected at the gateway and never stored. All other messages proceed to processing, where spam is detected and flagged at the thread level.
  </Step>

  <Step title="Parse">
    Nuntly extracts the message metadata (sender, recipients, subject, headers), body content (plain text and HTML), and attachments.
  </Step>

  <Step title="Route">
    The recipient address is matched against your inboxes. If an inbox address matches the local part of the recipient (for example, `support` in `support@yourdomain.com`), the message is routed there. If no match is found, it goes to the default catch-all inbox.
  </Step>

  <Step title="Store">
    The message is stored with its full content and threaded into an existing conversation or a new thread based on email headers and subject matching.
  </Step>

  <Step title="Notify">
    Webhook events are emitted so your application can react in real time. If the inbox has an AI agent assigned, a `message.agent.triggered` event is also sent.
  </Step>
</Steps>

## Key concepts

| Concept       | Description                                                                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------- |
| **Domain**    | A verified domain with receiving enabled. You configure MX records to route emails to Nuntly.                       |
| **Inbox**     | An address-based routing target on a domain (for example, `support@yourdomain.com`).                                |
| **Thread**    | A conversation grouping. Messages are threaded by `In-Reply-To` headers, `References` headers, or subject matching. |
| **Namespace** | An optional grouping layer for inboxes, useful for multi-tenant applications.                                       |
| **Agent**     | An AI agent identifier assigned to an inbox, enabling automated processing via webhooks and memory management.      |
| **Message**   | An individual received or sent email within a thread, including headers, content, and attachments.                  |

## What you can build

### Multi-tenant SaaS

Give each customer account their own namespace with isolated inboxes. Each account can have a `support@yourdomain.com` and `billing@yourdomain.com` grouped under a namespace tied to their account ID. Use the `externalId` field to map your internal tenant IDs directly — no extra lookup table needed. Scope all API queries to a namespace to retrieve only that tenant's messages and threads.

When a new account signs up, provision their namespace and inboxes programmatically. When an account is suspended or deleted, disable the namespace in a single call.

### Agencies

An agency managing email for multiple clients creates one namespace per client. Each client namespace gets a dedicated set of inboxes matched to their domain and workflow. The agency's backend maps client IDs to namespace IDs via `externalId` and scopes all queries accordingly — inbox lists, thread lists, message retrieval — without any risk of data leaking between clients.

Combine this with webhooks to build a unified inbox view across all clients, with routing logic that sends each incoming message to the right internal team.

### AI agent inboxes

Assign an AI agent to any inbox. Every incoming message triggers a `message.agent.triggered` webhook so your agent can wake up, read the message, and respond. The agent memory API persists conversation context across messages — your agent remembers what was discussed in previous exchanges, carries a rolling summary, and can track custom state like ticket IDs or priority levels.

This pattern works for any workflow where you want an LLM to handle email autonomously: customer intake, lead qualification, order acknowledgment, technical triage. Each agent can have its own namespace and a set of inboxes it manages independently. See [AI agent inboxes](/docs/guides/receiving-agents) for a full example with Claude.

### Reactive email automation

Email is often the trigger for a workflow, not just a communication channel. When an order confirmation arrives, create a fulfillment task. When an invoice lands in an inbox, start an approval flow. When a monitoring alert fires, open a ticket and notify the on-call engineer.

Nuntly extracts full message content — text, HTML, and raw MIME — and makes it available through presigned URLs. Your webhook handler fetches the body, parses whatever structure it contains, and kicks off the right action.

Auto-acknowledgment is a common companion pattern: reply to the sender immediately to confirm their request was received, then process it asynchronously.

### Helpdesk and customer support

Create dedicated inboxes for `support@`, `billing@`, and `technical@` on your domain. Each incoming email becomes a thread that preserves the full conversation history — including replies your team sends from the API. Your team can read unread threads, reply, and forward messages to the right person without leaving your application.

Connect the `message.received` webhook to your ticketing system via n8n, Make, or Zapier to automatically create and assign tickets. The thread model gives you everything needed to build a lightweight helpdesk directly on top of the API, or to feed a full-featured tool like Zendesk or Linear.

### Shared inbox for sales teams

Route all inbound sales inquiries through a single `sales@` inbox. When a new message arrives, a `message.received` webhook fires and your workflow starts: create a CRM contact, assign the lead to the right rep, log the conversation. Your team replies directly from the inbox and the full thread — including outbound messages — is tracked in one place.

No code server required for basic setups. A webhook pointing to an n8n or Make flow is enough to connect an inbox to a CRM, a Slack channel, or a Notion database.

## Next steps

<CardGroup cols={2}>
  <Card title="Set up receiving" icon="inbox" href="/docs/guides/receiving-setup">
    Enable receiving on your domain and configure DNS records
  </Card>

  <Card title="Inboxes" icon="mailbox" href="/docs/guides/receiving-inboxes">
    Create and manage inboxes to route incoming emails
  </Card>

  <Card title="Namespaces" icon="folder-tree" href="/docs/guides/receiving-namespaces">
    Organize inboxes for multi-tenant applications
  </Card>

  <Card title="AI agent inboxes" icon="bot" href="/docs/guides/receiving-agents">
    Assign AI agents to inboxes for automated processing
  </Card>
</CardGroup>
