Mailboxes

Cancel a mailbox send

Cancels a definitely unsent action and reopens its draft atomically.

POST
/v1/mailboxes/{id}/actions/{actionId}/cancel

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^mbx_[0-9a-hjkmnp-tv-z]{16,24}$
actionId*string
Match^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$

Response Body

MailboxSendReceipt

application/json
  1. response
actionId*MailboxActionId
Match^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$
draftId*|null
messageId*|null
threadId*|null
state*string
Value in"approvalRequired""queued""accepted""completed""notSent""uncertain"
acceptedAt*string|null
waitReason*|null
reviewExpectedAt*string|null
skippedRecipients*array<>
executeUntil*string|null
retryAt*string|null
problem*|null
retryEligible*boolean
decision*|null
createdAt*string
updatedAt*string
Example Request
import { 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"}

Related documentation