Mailboxes
Deny a mailbox action
Denies an action waiting for approval with a reason and returns it without executing it.
POST
Denies an action waiting for approval with a reason and returns it without executing it. Only a person signed in or through OAuth may deny, and never the one who proposed it. The action's resolution records the denier and reason; denying a held send 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}$application/json- body
reason*stringMailboxAction
application/json- response
id*MailboxActionIdMatch
^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$source*stringValue in
"humanUi""externalApi""aiSdkTool""extension""externalAgent""samvaManagedAgent""system"proposedBy*threadId*|nulldraftId*|nulldecision*|nullresolution*|How a held action's approval ended: who approved, denied, or cancelled it, when, and the denial reason. Null while it waits for approval and for an action that never needed one.
createdAt*stringupdatedAt*stringtype*stringValue in
"sendMessage""reply"state*stringValue in
"approvalRequired""queued""accepted""completed""notSent""uncertain"send*intent*||nullimport { createClient } from "samva";const samva = createClient({ authToken: process.env.SAMVA_AUTH_TOKEN!, orgSlug: process.env.SAMVA_ORG_SLUG! });const result = await samva.mailboxes.denyAction({ "id": "example", "actionId": "example", "reason": "example"});Example Response
{ "id": "string", "source": "humanUi", "proposedBy": { "kind": "user", "id": "string", "displayName": "string" }, "threadId": "string", "draftId": "string", "decision": { "outcome": "allow", "reason": "string", "policyId": "string", "source": "grant", "decidedAt": "string" }, "resolution": { "outcome": "approved", "actor": { "kind": "user", "id": "string", "displayName": "string", "source": "humanUi" }, "resolvedAt": "string", "reason": "string" }, "createdAt": "string", "updatedAt": "string", "type": "sendMessage", "state": "approvalRequired", "send": { "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" }, "intent": { "channel": "email", "draftRevision": 1, "from": "string", "fromName": "string", "to": [ "string" ], "cc": [ "string" ], "bcc": [ "string" ], "replyTo": [ "string" ], "subject": "string", "text": "string", "html": "string", "attachments": [ { "filename": "string", "content": "string", "mediaId": "string", "contentType": "string", "size": 1 } ], "threadId": "string", "conversationId": "string", "inReplyToMessageId": "string" }}