Skip to content

Discard a draft

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

mailbox
required
integer

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

Media typeapplication/json
object
id
required

Id of the draft to discard.

integer
Examples
Examplediscard
{
"id": 918
}

The draft was discarded.

Media typeapplication/json
object
message
string
draft_ids
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.",
"draft_ids": 918,
"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."
}