Release or reclassify a quarantined message
const url = 'https://mail.work.optidata.cloud/api/mail/mailboxes/78/spam/eyJkb21haW4iOiJhY21lLmV4YW1wbGUiLCJ1aWQiOjR9/actions';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"action":"release_and_train"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
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.
Opaque id of a quarantined message, exactly as returned by the quarantine listing.
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
Examples
{ "action": "release_and_train"}Responses
Section titled “ Responses ”The action was carried out.
object
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.
Where the message was placed by the filtering service.
The message’s id, echoed back.
The operation performed against the quarantine store.
Raw result reported by the quarantine store.
Examples
{ "action": "release_and_train", "target_folder": "Release and train", "identity": "eyJkb21haW4iOiJhY21lLmV4YW1wbGUiLCJ1aWQiOjR9", "command": "move", "command_result": "OK"}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 spam features are not enabled for this tenant.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Not available"}The action is not one of the supported values.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The selected action is invalid.", "errors": { "action": [ "The selected action is invalid." ] }}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."}