Skip to content

Release or reclassify a quarantined message

POST
/mail/mailboxes/{mailbox}/spam/{spamMessageId}/actions
curl --request POST \
--url https://mail.work.optidata.cloud/api/mail/mailboxes/78/spam/eyJkb21haW4iOiJhY21lLmV4YW1wbGUiLCJ1aWQiOjR9/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "action": "release_and_train" }'

Decide what happens to a message sitting in the quarantine:

  • release — deliver it to the mailbox, leaving the filter’s opinion alone.
  • release_and_train — deliver it and teach the filter it was not spam.
  • not_spam — teach the filter it was not spam, without delivering it.
  • spam — confirm the catch, so the filter treats similar mail the same way.

The response reports the action taken and where the message ended up.

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.

spamMessageId
required
string

Opaque id of a quarantined message, exactly as returned by the quarantine listing.

Media typeapplication/json
object
action
required

What to do with a quarantined message. release delivers it, not_spam teaches the filter it was caught wrongly, release_and_train does both, and spam confirms the catch.

string
Allowed values: release release_and_train not_spam spam
Examples
Examplerelease
{
"action": "release_and_train"
}

The action was carried out.

Media typeapplication/json
object
action

What to do with a quarantined message. release delivers it, not_spam teaches the filter it was caught wrongly, release_and_train does both, and spam confirms the catch.

string
Allowed values: release release_and_train not_spam spam
target_folder

Where the message was placed by the filtering service.

string
identity

The message’s id, echoed back.

string
command

The operation performed against the quarantine store.

string
command_result

Raw result reported by the quarantine store.

string | null
Examples
Examplereleased
{
"action": "release_and_train",
"target_folder": "Release and train",
"identity": "eyJkb21haW4iOiJhY21lLmV4YW1wbGUiLCJ1aWQiOjR9",
"command": "move",
"command_result": "OK"
}

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 action is not one of the supported values.

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
Exampleunsupported
{
"message": "The selected action is invalid.",
"errors": {
"action": [
"The selected action is invalid."
]
}
}

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