Discard several drafts
const url = 'https://mail.work.optidata.cloud/api/mail/mailboxes/78/drafts/batch';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"draft_ids":[918,919]}'};
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/batch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "draft_ids": [ 918, 919 ] }'Discard a batch of drafts in one call.
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
Ids of the drafts to discard.
Examples
{ "draft_ids": [ 918, 919 ]}Responses
Section titled “ Responses ”The drafts were discarded.
object
A mailbox the user has access to.
object
Cross-application user id the mailbox belongs to.
Example
{ "message": "Draft(s) deleted successfully.", "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."}