Skip to main content
Removes a staged draft from the account. The typical case is cleanup after re-staging: an agent writes a shorter version of a reply with create_draft and retires the first one, so the user finds a single draft in their mail client rather than two. The draft does not go to Trash. Afterwards get_draft and send_draft with the same id answer “Draft not found”. To change a draft rather than remove it, use update_draft.
Deletion is permanent: there is no Trash copy of the deleted version to restore. This tool is annotated destructive; clients that gate on destructiveHint will ask before calling it.
Only unsent drafts can be deleted. Sent or received mail is refused whatever id is passed, so the tool cannot destroy real mail — use trash_emails for that. A draft that was moved to Trash is still a draft and can be deleted.

Parameters

string
required
The draft to delete, as returned by create_draft, update_draft or list_drafts — edits do not change it — or a message id from search_emails with mailbox: "Drafts".

Example

Call
Result

Errors

Every refusal ends with Nothing was deleted., except a destroy the server left unanswered, where that cannot be asserted.
  • Draft not found: <id>. — the id does not resolve, or the draft was removed before the call reached it. Find drafts with list_drafts.
  • <id> is not a draft — it has already been sent or received… — the message is real mail. Read it with get_email.
  • Another call is already working on <id>… — a send_draft or another delete_draft for this draft is running. Wait, then read the draft back with get_draft.
  • An earlier send of <id> failed without saying whether the message went out. — check Sent before deciding.
  • The server did not say whether <id> was deleted. — read it back with get_draft before retrying.
  • The server refused to delete <id> (<type>). — the server answered the delete with an error of that type.