Save an edited draft
draft_editor_saveSave the fields a person edited in the draft editor. Every field is optional and an omitted one is left exactly as stored, unlike the draft tool's 'update', which requires the whole body. No signature is applied: the text being saved is the text the person was shown, which already carries one if the inbox has one. Nothing is sent. On IMAP the save returns a NEW draft_id and the old one stops resolving. A draft that has attachments cannot be saved here on IMAP or Gmail, because the save would rebuild the message without them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Replacement recipient list. Omit to keep the stored one; pass [] to clear it. | |
| to | No | Replacement recipient list. Omit to keep the stored one; pass [] to clear it. | |
| bcc | No | Replacement recipient list. Omit to keep the stored one; pass [] to clear it. | |
| inbox | No | The inbox's email address, as an alternative to inbox_id. | |
| subject | No | Replacement subject line. Omit to keep the stored one. | |
| draft_id | Yes | The draft to act on. On IMAP a draft_id changes on every save, so use the one the most recent draft result returned. | |
| inbox_id | No | The inbox holding the draft. Omit when the workspace has one inbox. | |
| body_text | No | Replacement plain-text body, written exactly as given. When the draft has an HTML part it is regenerated from this text, so both parts of the message say the same thing. Omit to keep the stored body. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card | No | Which card this envelope renders: 'draft_editor' or 'receipt'. | |
| state | No | Where the draft stands: editing, sent, or error. | |
| dashboard_url | No | Absolute link to the signed-in dashboard. Always present, and the one link that still works when the rest of the envelope cannot be parsed. | |
| schema_version | No | Card envelope version. A client that does not know this version should fall back to dashboard_url. |