export
Export emails from your mailbox in various formats (eml, markdown, json, html, csv). Supports single messages, batch exports, conversation threads, or raw MIME content.
Instructions
Export emails. target=message exports one email. target=messages batch-exports. target=conversation exports a thread. target=mime gets raw MIME/EML content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Export target (default: message) | |
| id | No | Email ID (target=message/mime, required) | |
| format | No | Export format. Valid values vary by target: target=message accepts mime/eml/markdown/json/csv (mbox and html are conversation-only). target=conversation accepts eml/mbox/markdown/json/html/csv. target=messages (batch) accepts markdown/json/csv. mime is an alias for eml (same RFC822 bytes, .eml extension on disk). | |
| savePath | No | File path or directory (target=message) | |
| includeAttachments | No | Include attachments (default: true for single, false for batch) | |
| emailIds | No | Email IDs to export (target=messages) | |
| searchQuery | No | Search query to find emails (target=messages, alternative to emailIds) | |
| query | No | Free-text search shortcut (target=messages). Equivalent to passing searchQuery: { subject: <query> }. Convenience alias for callers used to search-emails. | |
| outputDir | No | Output directory (target=messages/conversation, required) | |
| conversationId | No | Conversation ID (target=conversation, required) | |
| order | No | Message order (target=conversation, default: chronological) | |
| headersOnly | No | MIME headers only, no body (target=mime) | |
| base64 | No | Return base64 encoded (target=mime) | |
| maxSize | No | Max content size in bytes (target=mime, default: 1MB) |