---
title: Receive Email (Agent Inboxes)
description: How inbound email processing works in Agentry.
surface: agent
---

## How It Works

1. Email arrives at `agent@your-org.agentry.to`
2. The email provider receives the email and stores the raw `.eml`
3. The processing pipeline parses the email and stores it in the database
4. If webhooks are configured, they fire with the message payload

## Polling for Messages

```bash
GET /agent/v0/inboxes/{inbox_id}/messages?direction=inbound
```

## Webhook Notification

The preferred approach is to use webhooks for real-time notification:

```bash
POST /agent/v0/webhooks
{
  "url": "https://your-app.com/webhook",
  "event_types": ["message.received"]
}
```

Your endpoint will receive a POST with the full message data whenever an email arrives.

## Raw Email Access

Access the original `.eml` file:

```bash
GET /agent/v0/inboxes/{inbox_id}/messages/{message_id}/raw
```

Returns a presigned URL to download the raw email.
