Skip to content

Discard several drafts

DELETE
/mail/mailboxes/{mailbox}/drafts/batch
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.

mailbox
required
integer

Id of the mailbox. Every mailbox the caller may use is listed in their account.

Media typeapplication/json
object
draft_ids
required

Ids of the drafts to discard.

Array<integer>
Examples
Examplebatch
{
"draft_ids": [
918,
919
]
}

The drafts were discarded.

Media typeapplication/json
object
message
string
draft_ids
Array<integer>
mailbox

A mailbox the user has access to.

object
id
integer
user_id
integer
cuid

Cross-application user id the mailbox belongs to.

string
email
string format: email
created_at
string
updated_at
string
deleted_at
string | null
should_change_password
boolean
Example
{
"message": "Draft(s) deleted successfully.",
"mailbox": {
"id": 78
}
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller may not act on this mailbox, user or resource.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The conversations field is required.",
"errors": {
"conversation_ids": [
"The conversations field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}