# AgentMail List Messages

> AgentMail List Messages is a free API for AI agents from AgentMail at mpp.api.agentmail.to, Free, status unknown (last checked 2026-10-11, last successful call 2026-08-08).

Lists email messages in a specific AgentMail inbox with filtering by date, labels, and message status

## Facts

- Endpoint: GET https://mpp.api.agentmail.to/v0/inboxes/:inbox_id/messages?utm_source=zero.xyz
- Price: Free
- Status: unknown
- Last checked: 2026-10-11
- Last successful call: 2026-08-08
- Success rate: 100% of calls made through Zero
- Activations on Zero: 2
- Provider: AgentMail
- Docs: https://docs.agentmail.to
- Website: https://agentmail.to
- Tags: email, inboxes, domains, drafts, threads, webhooks, messaging, ai, social
- Canonical page: https://www.zero.xyz/c/agentmail-messages-44af3e44
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_stpppuqbh_8LNwzzBFh8d

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentmail-messages-44af3e44
```

Example prompt: Show me the last 20 messages in AgentMail inbox 'agent-123', sorted newest first, and include any spam — only messages labeled 'support' after January 1, 2025.

## When to prefer this

Use this endpoint when you need to list or browse messages in a specific AgentMail inbox, especially when filtering by date range, labels, or message status (spam/trash/blocked). Prefer this over thread-level endpoints when you need individual message metadata rather than threaded conversation views.

## Known failure modes

- Invalid or missing inbox_id returns 404 not found
- Missing or invalid Authorization Bearer token returns 401 unauthorized
- Malformed date-time format for before/after parameters returns 400 bad request
- Requesting a non-existent page_token returns empty result or error
- Rate limit exceeded returns 429 too many requests

## How this service works

List Messages

## Output

Returns a paginated list of MessageItem objects including message ID, thread ID, subject, sender, recipients (to/cc/bcc), labels, text preview, size in bytes, headers, and timestamps (sent, created, updated). Also returns the count of items returned and a limit field for pagination context.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "inbox_id"
 ],
 "properties": {
  "after": {
   "type": "string",
   "title": "After",
   "format": "date-time",
   "description": "Timestamp after which to filter by."
  },
  "limit": {
   "type": "integer",
   "title": "Limit",
   "description": "Limit of number of items returned."
  },
  "before": {
   "type": "string",
   "title": "Before",
   "format": "date-time",
   "description": "Timestamp before which to filter by."
  },
  "labels": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "title": "Labels",
   "description": "Labels to filter by."
  },
  "inbox_id": {
   "type": "string",
   "title": "InboxId",
   "description": "The ID of the inbox."
  },
  "ascending": {
   "type": "boolean",
   "title": "Ascending",
   "description": "Sort in ascending temporal order."
  },
  "page_token": {
   "type": "string",
   "title": "PageToken",
   "description": "Page token for pagination."
  },
  "include_spam": {
   "type": "boolean",
   "title": "IncludeSpam",
   "description": "Include spam in results."
  },
  "include_trash": {
   "type": "boolean",
   "title": "IncludeTrash",
   "description": "Include trash in results."
  },
  "include_blocked": {
   "type": "boolean",
   "title": "IncludeBlocked",
   "description": "Include blocked in results."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "title": "ListMessagesResponse",
 "required": [
  "count",
  "messages"
 ],
 "properties": {
  "count": {
   "type": "integer",
   "title": "Count",
   "description": "Number of items returned."
  },
  "limit": {
   "type": "integer",
   "title": "Limit",
   "description": "Limit of number of items returned."
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "MessageItem",
    "required": [
     "inbox_id",
     "thread_id",
     "message_id",
     "labels",
     "timestamp",
     "from",
     "to",
     "size",
     "updated_at",
     "created_at"
    ],
    "properties": {
     "cc": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "title": "MessageCc",
      "description": "Addresses of CC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`."
     },
     "to": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "title": "MessageTo",
      "description": "Addresses of recipients. In format `username@domain.com` or `Display Name <username@domain.com>`."
     },
     "bcc": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "title": "MessageBcc",
      "description": "Addresses of BCC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`."
     },
     "from": {
      "type": "string",
      "title": "MessageFrom",
      "description": "Address of sender. In format `username@domain.com` or `Display Name <username@domain.com>`."
     },
     "size": {
      "type": "integer",
      "title": "MessageSize",
      "description": "Size of message in bytes."
     },
     "labels": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "title": "MessageLabels",
      "description": "Labels of message."
     },
     "headers": {
      "type": "object",
      "title": "MessageHeaders",
      "description": "Headers in message.",
      "additionalProperties": {
       "type": "string"
      }
     },
     "preview": {
      "type": "string",
      "title": "MessagePreview",
      "description": "Text preview of message."
     },
     "subject": {
      "type": "string",
      "title": "MessageSubject",
      "description": "Subject of message."
     },
     "inbox_id": {
      "type": "string",
      "title": "InboxId",
      "description": "The ID of the inbox."
     },
     "thread_id": {
      "type": "string",
      "title":
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentmail-messages-44af3e44/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mpp.api.agentmail.to](https://www.zero.xyz/host/mpp.api.agentmail.to/llms.txt)
