# AgentMail List Messages by Direction and Type

> AgentMail List Messages by Direction and Type is a paid API for AI agents from x402.api.agentmail.to, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-12).

Lists email messages filtered by direction (inbound/outbound) and type via the AgentMail REST API for AI agents

## Facts

- Endpoint: GET https://x402.api.agentmail.to/v0/lists/%7Bdirection%7D/%7Btype%7D
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentmail-list-messages-by-direction-and-type-ee2e4b23
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Zdn0fV36k8hOaCMs6S7Gm

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-list-messages-by-direction-and-type-ee2e4b23
```

Example prompt: Show me all inbound emails of type 'message' from my AgentMail inbox — I want to see what messages my agent has received so far.

## When to prefer this

Use this endpoint when you need to list and browse email messages filtered by direction (inbound vs outbound) and message type within an AgentMail agent inbox. Prefer this over generic email APIs when building autonomous AI agent workflows that require programmatic access to structured email lists with x402 micropayment support.

## Known failure modes

- Invalid direction value returns 400 or empty result
- Invalid type value returns 400 or empty result
- No messages matching criteria returns empty list
- Authentication failure returns 401/402 requiring USDC payment
- Rate limiting or quota exceeded returns 429
- Malformed path parameters cause 404 or 422

## How this service works

AgentMail gives AI agents real email inboxes. Create, send, receive, and search messages via REST API — built for autonomous agents and agentic workflows.

## Output

Returns a JSON list of email messages matching the specified direction (e.g. inbound or outbound) and type, including message metadata such as sender, recipient, subject, and timestamps.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "pathParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "direction",
      "type"
     ],
     "properties": {
      "type": {
       "type": "string"
      },
      "direction": {
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    "queryParams": {
     "type": "object",
     "properties": {},
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "additionalProperties": true
    }
   },
   "additionalProperties": false
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {}
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentmail-list-messages-by-direction-and-type-ee2e4b23/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.api.agentmail.to](https://www.zero.xyz/host/x402.api.agentmail.to/llms.txt)
