Discard a draft
const url = 'https://mail.work.optidata.cloud/api/mail/mailboxes/78/drafts';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":918}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://mail.work.optidata.cloud/api/mail/mailboxes/78/drafts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": 918 }'Discard one draft and the files uploaded to it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Id of the mailbox. Every mailbox the caller may use is listed in their account.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Id of the draft to discard.
Examples
{ "id": 918}Responses
Section titled “ Responses ”The draft was discarded.
object
A mailbox the user has access to.
object
Cross-application user id the mailbox belongs to.
Example
{ "message": "Draft(s) deleted successfully.", "draft_ids": 918, "mailbox": { "id": 78 }}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller may not act on this mailbox, user or resource.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "This action is unauthorized."}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The conversations field is required.", "errors": { "conversation_ids": [ "The conversations field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}