Discard a quarantined message
Removes a held message from the mailbox's quarantine for good: it leaves the quarantine list, never reaches a thread, and can no longer be released.
POST
Removes a held message from the mailbox's quarantine for good: it leaves the quarantine list, never reaches a thread, and can no longer be released. Quarantined and isolated (malware) messages can both be discarded. Publishes one mailbox.message.discarded event; discarding it again returns the same result and publishes nothing. A released message is in its thread and cannot be discarded: 409. Only a person can discard; API keys never hold quarantine.release.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$messageId*stringMatch
^msg_[0-9a-hjkmnp-tv-z]{16,24}$MailboxQuarantinedMessage
application/json- response
id*MessageIdMatch
^msg_[0-9a-hjkmnp-tv-z]{16,24}$disposition*stringValue in
"quarantined""isolated"reason*stringValue in
"spam""dmarc""virus""virus_unscanned""phishing""fraud""prompt_injection"source*stringValue in
"receipt""classifier"from*subject*string|nullreceivedAt*stringheldAt*stringreleasedAt*string|nullthreadId*|nulldiscardedAt*string|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.mailboxes.discardMessage({
"id": "example",
"messageId": "example"
});Example Response
{
"id": "string",
"disposition": "quarantined",
"reason": "spam",
"source": "receipt",
"from": {
"address": "string",
"name": "string"
},
"subject": "string",
"receivedAt": "string",
"heldAt": "string",
"releasedAt": "string",
"threadId": "string",
"discardedAt": "string"
}