Approve a mailbox action
Records approval of a send and returns 202 while it is pending.
Records approval of a send and returns 202 while it is pending. A send is queued for automatic retry within 15 minutes of approval; repeating approval does not extend this deadline. Accepted, completed, and notSent replays return 200. No expiry applies before approval. Only a person signed in or through OAuth may approve, and never the proposer. Non-send approvals execute synchronously and return 200 with their own execution states. Set always: true to add an actor-specific rule allowing matching future actions, subject to policy floors and guards. Remembering an allowance for a hosted agent or API key requires an organization owner or admin; for a hosted agent's integration tool call it lets that tool run without approval for every agent, which only the organization owner may do. A held action's alwaysAllow says who may and whether the caller can. A hand-off cannot be always allowed. The action's resolution names the approver; approving a held send publishes one mailbox.action.resolved event.
apiKeyx-api-key<token>id*string^mbx_[0-9a-hjkmnp-tv-z]{16,24}$actionId*string^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
reviewRound*PolicyReviewRound0 < value <= 9007199254740991always?boolean|nulledits?|nullMailboxAction
application/json- response
id*MailboxActionId^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$source*string"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.
alwaysAllow*|Who may approve this held action with Always allow, and whether the caller may. Null for an action that is not held, a hand-off, and a reply held for integration data.
createdAt*stringupdatedAt*stringtype*string"sendMessage""reply"state*string"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.approveAction({
"id": "example",
"actionId": "example",
"reviewRound": 1
});{
"id": "string",
"source": "humanUi",
"proposedBy": {
"kind": "user",
"id": "string",
"displayName": "string"
},
"threadId": "string",
"draftId": "string",
"decision": {
"id": "string",
"reviewRound": 1,
"requirement": "run",
"decider": "rule",
"outcome": "allow",
"reason": "string",
"scopes": [
{
"kind": "organization",
"id": "string"
}
],
"rule": {
"scope": {
"kind": "organization",
"id": "string"
},
"index": 0
},
"guard": "string",
"guardReason": "string",
"resolution": {
"by": "string",
"at": "string",
"as": "approved",
"diff": {
"text": {
"before": "string",
"after": "string"
},
"html": {
"before": "string",
"after": "string"
}
}
}
},
"resolution": {
"outcome": "approved",
"actor": {
"kind": "user",
"id": "string",
"displayName": "string",
"source": "humanUi"
},
"resolvedAt": "string",
"reason": "string"
},
"alwaysAllow": {
"by": "owner",
"allowed": true
},
"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": {
"id": "string",
"reviewRound": 1,
"requirement": "run",
"decider": "rule",
"outcome": "allow",
"reason": "string",
"scopes": [
{
"kind": "organization",
"id": "string"
}
],
"rule": {
"scope": {
"kind": "organization",
"id": "string"
},
"index": 0
},
"guard": "string",
"guardReason": "string",
"resolution": {
"by": "string",
"at": "string",
"as": "approved",
"diff": {
"text": {
"before": "string",
"after": "string"
},
"html": {
"before": "string",
"after": "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"
}
}