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

# AgentMail

> Email inboxes for AI agents: list inboxes and read their messages and threads.

![](https://mintcdn.com/webrouter/Wx0iBZkUGX_VAFTN/logo/data-apis/agentmail.webp?fit=max\&auto=format\&n=Wx0iBZkUGX_VAFTN\&q=85\&s=2a4bd639cbc84743d88ebbfd7534b277)

[Web Catalog · Messaging](https://docs.webrouter.net/data-apis.md?category=messaging)

Needs&#x20;

`AGENTMAIL_API_KEY`

Endpoints

5

Auth

Key in header

[Vendor docs](https://docs.agentmail.to/)

## Setup

| Variable | | What it is |
| - | - | - |
| `AGENTMAIL_API_KEY` | required | An AgentMail API key from the AgentMail console. Sent as a Bearer token. |
| `AGENTMAIL_API_HOST` | optional | API host: api.agentmail.to (default) or api.agentmail.eu for the EU region. Default `api.agentmail.to`. One of `api.agentmail.to`, `api.agentmail.eu`. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Every path is under /v0 and scoped to an inbox: messages and threads need the inbox\_id returned by the inbox list.
* Lists page by token: pass next\_page\_token from a response back as page\_token.
* Free plan: 3 inboxes and 100 emails a day. A 429 carries Retry-After.

## Endpoints

GET

List inboxes

The inboxes in the organization.

[Open](#agentmail-inboxes-list)

GET

List messages in an inbox

Messages in an inbox, newest first, with filters on sender, recipient, subject, labels and time.

[Open](#agentmail-messages-list)

GET

Get a message

One message with bodies, attachments metadata, labels and SPF/DKIM/DMARC results.

[Open](#agentmail-messages-get)

GET

List threads in an inbox

Conversation threads in an inbox, with filters on senders, recipients, subject, labels and time.

[Open](#agentmail-threads-list)

GET

Get a thread

A thread with its messages.

[Open](#agentmail-threads-get)

### List inboxes

GET

`/v0/inboxes`

`agentmail.inboxes.list`

The inboxes in the organization.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Maximum items returned.
      </td>
    </tr>

    <tr>
      <td>
        `page_token`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Token for the next page.
      </td>
    </tr>

    <tr>
      <td>
        `ascending`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Oldest first.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.agentmail.to/api-reference/inboxes/list.md) · Same job: [AgentPhone](https://docs.webrouter.net/data-apis/agentphone.md#agentphone-conversations-list), [Slack](https://docs.webrouter.net/data-apis/slack.md#slack-conversations-list)

```python Python theme={null}
router.call_data_api("agentmail.inboxes.list")
```

```text MCP theme={null}
call_data_api(endpoint="agentmail.inboxes.list")
```

### List messages in an inbox

GET

`/v0/inboxes/{inbox_id}/messages`

`agentmail.messages.list`

Messages in an inbox, newest first, with filters on sender, recipient, subject, labels and time.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `inbox_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The inbox id.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Maximum items; at most 100 when filtering.
      </td>
    </tr>

    <tr>
      <td>
        `page_token`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Token for the next page.
      </td>
    </tr>

    <tr>
      <td>
        `labels`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Only messages with these labels.
      </td>
    </tr>

    <tr>
      <td>
        `before`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only messages before this datetime.
      </td>
    </tr>

    <tr>
      <td>
        `after`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only messages after this datetime.
      </td>
    </tr>

    <tr>
      <td>
        `ascending`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Oldest first.
      </td>
    </tr>

    <tr>
      <td>
        `include_spam`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include spam.
      </td>
    </tr>

    <tr>
      <td>
        `include_blocked`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include blocked messages.
      </td>
    </tr>

    <tr>
      <td>
        `include_unauthenticated`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include messages that failed authentication.
      </td>
    </tr>

    <tr>
      <td>
        `include_trash`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include trash.
      </td>
    </tr>

    <tr>
      <td>
        `from`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Sender substrings; all must match.
      </td>
    </tr>

    <tr>
      <td>
        `to`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Recipient (to, cc or bcc) substrings; all must match.
      </td>
    </tr>

    <tr>
      <td>
        `subject`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Subject substrings; all must match.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.agentmail.to/api-reference/inboxes/messages/list.md) · Same job: [AgentPhone](https://docs.webrouter.net/data-apis/agentphone.md#agentphone-numbers-messages), [Resend](https://docs.webrouter.net/data-apis/resend.md#resend-emails-received-list), [Saperly](https://docs.webrouter.net/data-apis/saperly.md#saperly-messages-list), [Slack](https://docs.webrouter.net/data-apis/slack.md#slack-conversations-history), [Sprout Social](https://docs.webrouter.net/data-apis/sprout-social.md#sprout-social-messages-list), [Twilio](https://docs.webrouter.net/data-apis/twilio.md#twilio-messages-list)

> [!NOTE]
>
> * Spam, blocked, unauthenticated and trashed messages are left out unless the include\_ flags are set.

### Get a message

GET

`/v0/inboxes/{inbox_id}/messages/{message_id}`

`agentmail.messages.get`

One message with bodies, attachments metadata, labels and SPF/DKIM/DMARC results.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `inbox_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The inbox id.
      </td>
    </tr>

    <tr>
      <td>
        `message_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The message id.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.agentmail.to/api-reference/inboxes/messages/get.md)

> [!NOTE]
>
> * extracted\_text and extracted\_html hold only the new content, without quoted earlier replies; text and html are the full bodies.

### List threads in an inbox

GET

`/v0/inboxes/{inbox_id}/threads`

`agentmail.threads.list`

Conversation threads in an inbox, with filters on senders, recipients, subject, labels and time.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `inbox_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The inbox id.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Maximum items returned.
      </td>
    </tr>

    <tr>
      <td>
        `page_token`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Token for the next page.
      </td>
    </tr>

    <tr>
      <td>
        `labels`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Only threads with these labels.
      </td>
    </tr>

    <tr>
      <td>
        `before`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only threads before this datetime.
      </td>
    </tr>

    <tr>
      <td>
        `after`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only threads after this datetime.
      </td>
    </tr>

    <tr>
      <td>
        `ascending`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Oldest first.
      </td>
    </tr>

    <tr>
      <td>
        `include_spam`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include spam.
      </td>
    </tr>

    <tr>
      <td>
        `include_blocked`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include blocked.
      </td>
    </tr>

    <tr>
      <td>
        `include_unauthenticated`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include unauthenticated.
      </td>
    </tr>

    <tr>
      <td>
        `include_trash`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include trash.
      </td>
    </tr>

    <tr>
      <td>
        `senders`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Sender substrings; all must match.
      </td>
    </tr>

    <tr>
      <td>
        `recipients`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Recipient substrings; all must match.
      </td>
    </tr>

    <tr>
      <td>
        `subject`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Subject substrings; all must match.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.agentmail.to/api-reference/inboxes/threads/list.md) · Same job: [AgentPhone](https://docs.webrouter.net/data-apis/agentphone.md#agentphone-numbers-messages), [Resend](https://docs.webrouter.net/data-apis/resend.md#resend-emails-received-list), [Saperly](https://docs.webrouter.net/data-apis/saperly.md#saperly-messages-list), [Slack](https://docs.webrouter.net/data-apis/slack.md#slack-conversations-history), [Sprout Social](https://docs.webrouter.net/data-apis/sprout-social.md#sprout-social-messages-list), [Twilio](https://docs.webrouter.net/data-apis/twilio.md#twilio-messages-list)

### Get a thread

GET

`/v0/inboxes/{inbox_id}/threads/{thread_id}`

`agentmail.threads.get`

A thread with its messages.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `inbox_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The inbox id.
      </td>
    </tr>

    <tr>
      <td>
        `thread_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The thread id.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Messages returned, at most 100.
      </td>
    </tr>

    <tr>
      <td>
        `page_token`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Token for the next (older) page of messages.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.agentmail.to/api-reference/inboxes/threads/get.md) · Same job: [AgentPhone](https://docs.webrouter.net/data-apis/agentphone.md#agentphone-conversations-messages), [Slack](https://docs.webrouter.net/data-apis/slack.md#slack-conversations-replies)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.