Mailboxes
Create a mailbox policy
Adds a send policy to a mailbox and returns it with status 201.
POST
Adds a send policy to a mailbox and returns it with status 201. It applies to every send proposed after it is created, whoever proposes it. A mailbox that already holds 20 policies conflicts.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
name*stringMatch
^\S[\s\S]*\S$|^\S$|^$Length
1 <= length <= 128outcome*MailboxPolicyOutcomeKindValue in
"requireApproval""deny"reason?|nullenabled?boolean|nullSuccess
application/json- response
id*MailboxPolicyIdMatch
^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$name*stringoutcome*MailboxPolicyOutcomeKindValue in
"requireApproval""deny"reason*string|nullenabled*booleancreatedAt*stringupdatedAt*stringimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.mailboxes.createPolicy({ "id": "example", "name": "example", "outcome": "requireApproval"});Example Response
{ "id": "string", "name": "string", "outcome": "requireApproval", "reason": "string", "enabled": true, "createdAt": "string", "updatedAt": "string"}