Discard staged attachment
discard_attachmentPermanently delete a staged outgoing attachment and invalidate its token. Use it to cancel or replace an uploaded file before creating a draft; the action cannot be undone.
Instructions
Permanently remove one staged outgoing attachment before it is used, destroying its token and the staged bytes. Use it when the user cancels an attachment or replaces a wrong file after finish_attachment_upload. It is not needed after a draft is created, which already consumes the token, and it cannot be undone: a second call with the same token fails, and restaging means starting again at begin_attachment_upload. It touches staged outgoing bytes only and never deletes mail, a draft, or a received attachment. It returns discarded: true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attachment_token | Yes | The attachment_token finish_attachment_upload returned, not the upload_id. It is single-use, so a token already spent by create_confirmed_draft or by an earlier discard is refused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||