# AgentMail Get Email Attachment

> AgentMail Get Email Attachment is a free API for AI agents from x402.api.agentmail.to, callable via x402, Free, status unknown (last checked 2026-09-14).

Retrieve a specific email attachment from a thread within a pod (inbox) by its attachment ID

## Facts

- Endpoint: GET https://x402.api.agentmail.to/v0/pods/%7Bpod_id%7D/threads/%7Bthread_id%7D/attachments/%7Battachment_id%7D
- Price: Free
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentmail-get-email-attachment-fec5ba46
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tc9rGHCTKO90P_W1qYGdm

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-get-email-attachment-fec5ba46
```

Example prompt: Fetch the attachment with ID attach_abc123 from thread thread_xyz789 in my AgentMail pod pod_001 so I can read the file that was sent.

## When to prefer this

Use this endpoint when an AI agent needs to retrieve a specific email attachment it already knows the ID of — for example, after listing threads or messages and identifying a relevant attachment. Prefer this over generic file storage retrieval when working within the AgentMail ecosystem for agent-driven email workflows.

## Known failure modes

- 404 if pod_id, thread_id, or attachment_id does not exist or is not accessible
- 401/403 if authentication is missing or insufficient
- 400 if required path parameters are malformed or missing
- Empty or minimal response if attachment has no metadata

## 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 JSON containing the attachment data and/or metadata for the specified attachment in the given email thread and pod — including content, filename, MIME type, or download URL depending on the API response structure.

## 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": [
      "pod_id",
      "thread_id",
      "attachment_id"
     ],
     "properties": {
      "pod_id": {
       "type": "string"
      },
      "thread_id": {
       "type": "string"
      },
      "attachment_id": {
       "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-get-email-attachment-fec5ba46/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)
