Mailboxes
Cancel a mailbox send
Cancels a definitely unsent action and reopens its draft atomically.
POST
Cancels a definitely unsent action and reopens its draft atomically. Only an authorized person who proposed the send or can approve actions may cancel. Accepted sends return 409 with their winning receipt and cannot be withdrawn. An uncertain send requires reconciliation and cannot be cancelled as unsent. Cancelling a send held for approval records resolution.outcome: cancelled and publishes one mailbox.action.resolved event.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$actionId*stringMatch
^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$MailboxSendReceipt
application/json- response
actionId*MailboxActionIdMatch
^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$draftId*|nullmessageId*|nullthreadId*|nullstate*stringValue in
"approvalRequired""queued""accepted""completed""notSent""uncertain"acceptedAt*string|nullwaitReason*|nullreviewExpectedAt*string|nullskippedRecipients*array<>executeUntil*string|nullretryAt*string|nullproblem*|nullretryEligible*booleandecision*|nullcreatedAt*stringupdatedAt*stringimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.mailboxes.cancelAction({ "id": "example", "actionId": "example"});Example Response
{ "actionId": "string", "draftId": "string", "messageId": "string", "threadId": "string", "state": "approvalRequired", "acceptedAt": "string", "waitReason": "rate", "reviewExpectedAt": "string", "skippedRecipients": [ { "address": "string", "reason": "bounce", "topicId": "string" } ], "executeUntil": "string", "retryAt": "string", "problem": { "code": "string", "message": "string", "error": { "_tag": "SenderNotReadyError", "message": "string", "sender": "string", "retryAfterSeconds": 0 } }, "retryEligible": true, "decision": { "outcome": "allow", "reason": "string", "policyId": "string", "source": "grant", "decidedAt": "string" }, "createdAt": "string", "updatedAt": "string"}