Download an attachment
proton_get_attachmentReturns the base64-encoded bytes of a specific email attachment by its index. Supports truncation of large attachments with a maximum size limit.
Instructions
Returns the bytes of a specific attachment encoded as base64. Use the attachment index from proton_get_email. Large attachments are truncated to max_bytes (default 10 MB) with a truncated=true flag in the response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | ||
| index | Yes | Zero-based index in the attachments array | |
| mailbox | No | INBOX | |
| max_bytes | No | Maximum attachment size in bytes (default 10 MB, hard cap 50 MB) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base64 | Yes | ||
| filename | No | ||
| truncated | Yes | ||
| size_bytes | Yes | ||
| contentType | Yes | ||
| returned_bytes | Yes |