Send a draft
POST
/drafts/{id}/sendQueues a draft for sending. It leaves after the 30-second undo window, or at sendAt if you set one. Sending the same draft twice is safe: the second call returns the same message with alreadySent set to true.
Needs the permissiondrafts:send
Path parameters
idstringrequired- The draft to send.
Body
sendAtstringoptional- When to send it, as an ISO 8601 time. Leave it out to send as soon as the undo window closes.
Returns
messageIdstring- The message that will be sent. It’s the draft’s own id.
threadIdstring- The conversation it belongs to.
statusstringqueued, orscheduledwithsendAt. PollGET /messages/{id}to see sending, sent or failed.scheduledAtstring or null- When it will go, if you set
sendAt. undoSecondsnumber- How long it can still be cancelled: 30. A scheduled send says 0, and can be cancelled until its time. Delete the draft to cancel.
alreadySentboolean- Only on a repeat call: true, and nothing was sent again.
Errors
400no_recipient- The draft has no one in
to. 400bad_send_atsendAtisn’t an ISO 8601 time, orsend_at_in_past: it has passed.400send_failed- It couldn’t be queued. The message says why.
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:send. TheX-Required-Scopeheader names what’s missing. 404not_found- There is no such draft, or the key’s owner can’t see it.
409draft_locked- Somebody has the draft open in DMU Mail right now.
429rate_limited- More than 120 requests, or more than 30 sends, a minute from this key. Wait for
Retry-Afterseconds.