Discard a draft

DELETE/api/v1/mailbox/messages/draft/{message_id}
Requires amailbox token— it acts as one mailbox holder, not as the organization.

Permanently removes a draft. Allowed outside Trash because a draft the author just discarded was never delivered mail — and for that reason refused (409 not_a_draft) for anything not in the Drafts folder.

Errors

Status When
401 No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login.
403 The account has a temporary password: until POST /security/password succeeds, every other call answers this with error_code: password_change_required.
400 The id is malformed or is not a draft.

Parameters

NameInTypeDescription
message_idrequiredpathstring

Request

DELETE/api/v1/mailbox/messages/draft/{message_id}
curl -X DELETE 'https://courier.mailyte.com/api/v1/mailbox/messages/draft/01JBT8XQ2M9WYC3K4F6R7S8T9V' \
  -H 'Authorization: Bearer MAILBOX_TOKEN'

Response

Discarded.

200application/json
{
  "type": "success",
  "msg": "Draft discarded"
}

Returned inside the standard envelope.

Errors

StatusWhen
400The id is malformed or is not a draft.
401No token, or the session expired or was signed out. Sign in again with `POST /mailbox-auth/login`.
403The account has a temporary password: until `POST /security/password` succeeds, every other call answers this with `error_code: password_change_required`.
422Validation Error

Every status, with what causes it and what to do, is on the error reference.