Skip to content

Delete quarantined messages

DELETE
/mail/mailboxes/{mailbox}/spam
curl --request DELETE \
--url https://mail.work.optidata.cloud/api/mail/mailboxes/78/spam \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "conversation_ids": [ "eyJkb21haW4iOiJhY21lLmV4YW1wbGUiLCJ1aWQiOjR9" ] }'

Permanently remove messages from the quarantine.

Requires the spam feature to be enabled for the tenant.

mailbox
required
integer

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

Media typeapplication/json
object
conversation_ids
required

Ids of the threads to act on.

Array<string>
>= 1 items
Examples
Examplepurge
{
"conversation_ids": [
"eyJkb21haW4iOiJhY21lLmV4YW1wbGUiLCJ1aWQiOjR9"
]
}

The messages were removed from the quarantine.

Media typeapplication/json
object
conversation_ids
Array<string>
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
{
"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 spam features are not enabled for this tenant.

Media typeapplication/json

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

object
message
required

Human-readable description of the failure.

string
Examples
Exampledisabled
{
"message": "Not available"
}

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."
}