# AgentMail Get Thread Attachment

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

Retrieves a specific email attachment by its ID from a given email thread in an AI agent's inbox

## Facts

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

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-thread-attachment-8b12aec5
```

Example prompt: Can you grab the attachment with ID att_abc123 from email thread thd_xyz789 in my AgentMail inbox so I can read what's in it?

## When to prefer this

Use this endpoint when an AI agent needs to retrieve a specific, known attachment from an email thread — for example, when processing an email workflow that involves reading a PDF, spreadsheet, or other file that was attached to a message. Prefer this over listing endpoints when you already have both the thread ID and attachment ID.

## Known failure modes

- Thread ID not found — 404 error if the thread does not exist
- Attachment ID not found — 404 error if the attachment does not exist within the thread
- Unauthorized access — 401 if the agent lacks permission to access the inbox
- Invalid path parameters — 400 if thread_id or attachment_id are malformed
- Rate limiting — 429 if too many requests are made in a short period

## 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 object containing the attachment data for the specified attachment ID within the given thread, including file content, metadata, and any relevant properties of the attachment.

## 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": [
      "thread_id",
      "attachment_id"
     ],
     "properties": {
      "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-thread-attachment-8b12aec5/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)
