TypeScript SDK: Security
The methods of the TypeScript client under Security. Risk assessment and sender trust: the policy that warns, holds and guards sending, the senders an inbox knows, held mail and the audit log.
client.inboxes.security.get
client.inboxes.security.get(inboxId: string): Promise<SecuritySettings>Sends inboxes.security.get: GET /v1/inboxes/{inboxId}/security
The policy in force for one inbox (inherited says whether it follows the account's).
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.inboxes.security.update
client.inboxes.security.update(inboxId: string, body: UpdateSecurityPolicy): Promise<SecuritySettings>Sends inboxes.security.update: PATCH /v1/inboxes/{inboxId}/security
Give an inbox its own security policy. Loosening needs a session unless allowed.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.inboxes.security.reset
client.inboxes.security.reset(inboxId: string): Promise<void>Sends inboxes.security.reset: DELETE /v1/inboxes/{inboxId}/security
Remove the inbox's override so it follows the account's policy again.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.inboxes.senders.list
client.inboxes.senders.list(inboxId: string, params: ListSendersParams = {}): Promise<SenderPage>Sends inboxes.senders.list: GET /v1/inboxes/{inboxId}/senders
Everyone the inbox has heard from or written to, most recent first, with their standing.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.inboxes.senders.iterate
client.inboxes.senders.iterate(inboxId: string, params: ListSendersParams = {}): AsyncGenerator<Sender, void, undefined>Every sender of the inbox, page by page.
client.inboxes.held.list
client.inboxes.held.list(inboxId: string, params: PageParams = {}): Promise<HeldMessagePage>Sends inboxes.held.list: GET /v1/inboxes/{inboxId}/held
Messages held for review under the security policy, newest first.
Access any: any API key, or a console session. An app token needs mail:read.
client.inboxes.held.iterate
client.inboxes.held.iterate(inboxId: string, params: PageParams = {}): AsyncGenerator<HeldMessage, void, undefined>Every held message stub of the inbox, page by page.
client.inboxes.heldSends.list
client.inboxes.heldSends.list(inboxId: string, params: ListHeldSendsParams = {}): Promise<HeldSendPage>Sends inboxes.heldSends.list: GET /v1/inboxes/{inboxId}/held-sends
The messages that wait for the owner, newest first: sends the policy kept, and drafts.
Access any: any API key, or a console session. App tokens are refused.
client.inboxes.heldSends.iterate
client.inboxes.heldSends.iterate(inboxId: string, params: ListHeldSendsParams = {}): AsyncGenerator<HeldSend, void, undefined>Every held send of the inbox in one state, page by page.
client.messages.release
client.messages.release(messageId: string): Promise<Message>Sends messages.release: POST /v1/messages/{messageId}/release
Deliver a held message into its conversation and emit message.received.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.messages.discard
client.messages.discard(messageId: string): Promise<void>Sends messages.discard: POST /v1/messages/{messageId}/discard
Trash a held message without ever delivering it.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.messages.feedback
client.messages.feedback(messageId: string, body: RiskFeedback): Promise<Message>Sends messages.feedback: POST /v1/messages/{messageId}/feedback
Record the owner's safe or unsafe verdict on an assessed inbound message.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.security.get
client.security.get(): Promise<SecuritySettings>Sends security.get: GET /v1/security
The account's security policy, enforcement mode and model analysis availability.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.security.update
client.security.update(body: UpdateSecurityPolicy): Promise<SecuritySettings>Sends security.update: PATCH /v1/security
Apply a preset or update policy fields on the account. Loosening needs a session unless allowed.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.security.audit
client.security.audit(params: ListSecurityAuditParams = {}): Promise<SecurityAuditPage>Sends security.audit: GET /v1/security/audit
Every change to security policies, sender rules and held messages, newest first.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.security.iterateAudit
client.security.iterateAudit(params: ListSecurityAuditParams = {}): AsyncGenerator<SecurityAuditEntry, void, undefined>Every entry of the security audit log, page by page.
client.security.preview
client.security.preview(body: SecurityPreviewRequest): Promise<SecurityPreview>Sends security.preview: POST /v1/security/preview
Evaluate a sample, stored message or custom body against the active or a draft policy.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.senderRules.list
client.senderRules.list(params: ListSenderRulesParams = {}): Promise<SenderRulePage>Sends senderRules.list: GET /v1/sender-rules
The account's trusted and blocked sender rules, newest first.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.senderRules.iterate
client.senderRules.iterate(params: ListSenderRulesParams = {}): AsyncGenerator<SenderRule, void, undefined>Every sender rule matching the filters, page by page.
client.senderRules.create
client.senderRules.create(body: CreateSenderRule): Promise<SenderRule>Sends senderRules.create: POST /v1/sender-rules
Trust or block an email address or domain.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.senderRules.delete
client.senderRules.delete(senderRuleId: string): Promise<void>Sends senderRules.delete: DELETE /v1/sender-rules/{senderRuleId}
Remove a sender rule so matching senders return to learned standing.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.heldSends.get
client.heldSends.get(heldSendId: string): Promise<HeldSend>Sends heldSends.get: GET /v1/held-sends/{heldSendId}
Where a held send stands: waiting, sent, discarded or expired.
Access any: any API key, or a console session. An app token needs mail:read.
client.heldSends.approve
client.heldSends.approve(heldSendId: string): Promise<SentMessage>Sends heldSends.approve: POST /v1/held-sends/{heldSendId}/approve
Send a held send as it was asked for, now. Needs a session unless allowed.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.heldSends.discard
client.heldSends.discard(heldSendId: string): Promise<void>Sends heldSends.discard: POST /v1/held-sends/{heldSendId}/discard
End a held send without sending it. Nothing brings it back.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

