Delete a draft
DELETE
/drafts/{id}Discards a draft or, if it has been sent and is still waiting to go, cancels the send.
Needs the permissiondrafts:delete
A send waits 30 seconds before it goes, and a scheduled one waits until its time. Until then this pulls it back and says cancelled: true. Once it has started to go you get 409 already_sent: a cancel that said yes while the mail went anyway would be worse than one that says no.
Deleting a draft that’s already gone succeeds, so a retry after a lost response doesn’t look like a failure.
Path parameters
idstringrequired- The draft.
Returns
idstring- The draft.
deletedboolean- Always true.
cancelledboolean- True when a send was pulled back. Left out when the draft was already gone.
Errors
401invalid_key- The key is wrong, expired or revoked. With no Authorization header at all, the code is
missing_credentials. 403missing_scope- The key doesn’t have
drafts:delete. TheX-Required-Scopeheader names what’s missing. 409already_sent- It has started to go and can’t be taken back.
409draft_locked- Somebody has the draft open in DMU Mail right now.
429rate_limited- More than 120 requests a minute from this key. Wait for
Retry-Afterseconds.