save_attachment
Saves a single email attachment to disk by its attachment ID, returning the file path. Use when you have a specific attachment ID from list_attachments.
Instructions
Save a single email attachment to disk by its attachmentId and return the written file path. Use when you have a specific attachmentId from list_attachments and want to write that file. Prefer save_attachments to save all or filtered attachments from an email without needing individual attachment IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emailId | Yes | Composite email id in FOLDER::UID format, as returned by get_emails or search_emails. | |
| attachmentId | Yes | Stable attachment id returned by list_attachments. | |
| outputPath | No | Optional file or directory path to write to. | |
| saveTo | No | Relative path within PROTONMAIL_ALLOW_FILE_DOWNLOAD_DIR to save attachment to disk. Returns file path and size instead of inline base64. Requires env var to be set. Set PROTONMAIL_MAX_INLINE_BYTES (in KB, default 40) to configure the inline size threshold. |