save_draft
Create or replace a Proton Mail draft with optional HTML, plain-text body, and file attachments, including threading headers.
Instructions
Create a complete Proton Mail draft, or replace an existing draft when uid and uidvalidity are provided. Supports plain text, an optional HTML alternative, and bounded attachments supplied either inline as base64 (content_base64) or as an absolute path to a local file that the server reads at save time (content_path). To reply inside a thread, read the message with get_email and set in_reply_to to its message_id, and references to its references followed by its message_id; when it reports no references, use its in_reply_to in their place so earlier ancestry survives. A replacement keeps the previous draft's Message-ID, plus whichever of its In-Reply-To and References the call omits; passing an empty array for either removes it, detaching the draft from its thread. Updating appends the replacement before removing the old UID; inspect warning if cleanup was incomplete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Cc recipient addresses | |
| to | No | To recipient addresses | |
| bcc | No | Bcc recipient addresses retained in the saved draft | |
| uid | No | existing draft UID to replace; requires uidvalidity | |
| from | Yes | sender address; must be one of the Proton account addresses exposed by Bridge | |
| subject | No | ||
| html_body | No | optional HTML alternative, up to 50000 characters | |
| text_body | No | plain-text body, up to 50000 characters | |
| references | No | conversation chain: the parent email's references followed by its message_id; set together with in_reply_to so clients thread the reply; when replacing a draft, omit to keep the existing header or pass an empty array to remove it | |
| attachments | No | regular file attachments; at most 100 and 25 MB decoded in total | |
| in_reply_to | No | Message-IDs this draft replies to, normally just the message_id of the email being answered; angle brackets optional; when replacing a draft, omit to keep the existing header or pass an empty array to remove it | |
| uidvalidity | No | Drafts UIDVALIDITY accompanying uid |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | UID of the newly saved draft | |
| folder | Yes | ||
| warning | No | ||
| uidvalidity | Yes | Drafts folder generation accompanying uid | |
| replaced_uid | No | ||
| previous_draft_removed | Yes |