# Agent Mail

AgentMail provides AI agents with their own email inboxes, enabling them to send, receive, and act upon emails for communication with services, people, and other agents.

- **Category:** ai agents
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 3
- **Triggers:** 1
- **Slug:** `AGENT_MAIL`
- **Version:** 20260227_00

## Tools

### Get Message

**Slug:** `AGENT_MAIL_GET_MESSAGE`

Retrieve the complete details of a specific email message from an AgentMail inbox. This action returns the full message content including sender, recipients, subject, body (both text and HTML), attachments, labels, and metadata. Use this to read individual messages after discovering them via LIST_MESSAGES or webhooks.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `inbox_id` | string | Yes | MUST be a valid email address (e.g., agent@agentmail.to). This is NOT an ID or identifier - it must be a full email address of the inbox. |
| `message_id` | string | Yes | The unique message ID to retrieve (typically in email Message-ID format with angle brackets) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Messages

**Slug:** `AGENT_MAIL_LIST_MESSAGES`

List messages from an AgentMail inbox

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `after` | string | No | Return messages sent after this timestamp (ISO 8601 format) |
| `limit` | integer | No | Maximum number of messages to return (1-100) |
| `before` | string | No | Return messages sent before this timestamp (ISO 8601 format) |
| `labels` | array | No | Filter messages by labels (e.g., 'sent', 'unread', 'important') |
| `inbox_id` | string | Yes | MUST be a valid email address (e.g., agent@agentmail.to). This is NOT an ID or identifier - it must be a full email address of the inbox. |
| `ascending` | boolean | No | Sort messages in ascending order by timestamp (oldest first). Default is descending (newest first) |
| `page_token` | string | No | Token for pagination to get the next set of results |
| `include_spam` | boolean | No | Include messages marked as spam in the results |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Send Email

**Slug:** `AGENT_MAIL_SEND_EMAIL`

Send an email using AgentMail API

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `cc` | array | No | List of CC recipient email addresses |
| `to` | array | Yes | List of recipient email addresses |
| `bcc` | array | No | List of BCC recipient email addresses |
| `html` | string | No | HTML content of the email. Either text or html (or both) must be provided. If both are provided, email clients will typically prefer HTML with text as fallback. |
| `text` | string | No | Plain text content of the email. Either text or html (or both) must be provided. |
| `labels` | array | No | Labels to apply to the sent message |
| `subject` | string | Yes | Email subject line |
| `inbox_id` | string | Yes | The inbox identifier (typically the full email address, e.g., 'your-inbox@agentmail.to') |
| `reply_to` | array | No | Reply-to email addresses |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |


## Triggers

### New Email Received

**Slug:** `AGENT_MAIL_NEW_EMAIL_TRIGGER`

**Type:** poll

Trigger for new emails in an AgentMail inbox

#### Configuration

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `inbox_id` | string | Yes | The inbox ID or email address to monitor for new emails |
| `interval` | number | No | Periodic Interval to Check for Updates & Send a Trigger in Minutes |
| `labels` | array | No | Filter messages by specific labels (e.g., 'unread', 'inbox') |

#### Payload

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `attachments` | array | No | Message attachments |
| `bcc` | array | No | BCC email addresses |
| `cc` | array | No | CC email addresses |
| `created_at` | string | Yes | When the message was created |
| `from` | string | Yes | Sender's email address |
| `html` | string | No | HTML content |
| `in_reply_to` | string | No | ID of message being replied to |
| `inbox_id` | string | Yes | ID of the inbox |
| `labels` | array | Yes | Labels applied to the message |
| `message_id` | string | Yes | ID of the message |
| `preview` | string | No | Text preview of the message |
| `references` | array | No | IDs of previous messages in thread |
| `reply_to` | array | No | Reply-to email addresses |
| `subject` | string | No | Email subject |
| `text` | string | No | Plain text content |
| `thread_id` | string | Yes | ID of the thread |
| `timestamp` | string | Yes | When the message was received |
| `to` | array | Yes | Recipient email addresses |
| `updated_at` | string | Yes | When the message was last updated |
