Python SDK: Security
The methods of the Python 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.held_sends.approve
client.held_sends.approve(held_send_id: str) -> models.SentMessageSends heldSends.approve: POST /v1/held-sends/{heldSendId}/approve
Send a held send.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.held_sends.discard
client.held_sends.discard(held_send_id: str) -> NoneSends heldSends.discard: POST /v1/held-sends/{heldSendId}/discard
Discard a held send.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.held_sends.get
client.held_sends.get(held_send_id: str) -> models.HeldSendSends heldSends.get: GET /v1/held-sends/{heldSendId}
Read a held send.
Access any: any API key, or a console session. An app token needs mail:read.
client.inboxes.held.list
client.inboxes.held.list(inbox_id: str, *, limit: int | None = None, offset: int | None = None) -> models.HeldMessagePageSends inboxes.held.list: GET /v1/inboxes/{inboxId}/held
List held messages.
Access any: any API key, or a console session. An app token needs mail:read.
client.inboxes.held.iterate
client.inboxes.held.iterate(inbox_id: str, *, limit: int | None = None, offset: int | None = None) -> Iterator[models.HeldMessage]Every item of client.inboxes.held.list, one page at a time: the next page is asked for when the loop reaches it. A page that does not advance raises ApiError.
client.inboxes.held_sends.list
client.inboxes.held_sends.list(inbox_id: str, *, status: Literal['held', 'sent', 'discarded', 'expired'] | None = None, kind: Literal['held', 'draft'] | None = None, limit: int | None = None, offset: int | None = None) -> models.HeldSendPageSends inboxes.heldSends.list: GET /v1/inboxes/{inboxId}/held-sends
List held sends.
Access any: any API key, or a console session. App tokens are refused.
client.inboxes.held_sends.iterate
client.inboxes.held_sends.iterate(inbox_id: str, *, status: Literal['held', 'sent', 'discarded', 'expired'] | None = None, kind: Literal['held', 'draft'] | None = None, limit: int | None = None, offset: int | None = None) -> Iterator[models.HeldSend]Every item of client.inboxes.held_sends.list, one page at a time: the next page is asked for when the loop reaches it. A page that does not advance raises ApiError.
client.inboxes.security.get
client.inboxes.security.get(inbox_id: str) -> models.SecuritySettingsSends inboxes.security.get: GET /v1/inboxes/{inboxId}/security
Read an inbox's security policy.
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(inbox_id: str) -> NoneSends inboxes.security.reset: DELETE /v1/inboxes/{inboxId}/security
Return an inbox to the account's security policy.
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(inbox_id: str, body: models.UpdateSecurityPolicy) -> models.SecuritySettingsSends inboxes.security.update: PATCH /v1/inboxes/{inboxId}/security
Give an inbox its own security policy.
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(inbox_id: str, *, standing: Literal['trusted', 'known', 'new', 'blocked'] | None = None, q: str | None = None, limit: int | None = None, offset: int | None = None) -> models.SenderPageSends inboxes.senders.list: GET /v1/inboxes/{inboxId}/senders
List an inbox's senders.
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(inbox_id: str, *, standing: Literal['trusted', 'known', 'new', 'blocked'] | None = None, q: str | None = None, limit: int | None = None, offset: int | None = None) -> Iterator[models.Sender]Every item of client.inboxes.senders.list, one page at a time: the next page is asked for when the loop reaches it. A page that does not advance raises ApiError.
client.messages.discard
client.messages.discard(message_id: str) -> NoneSends messages.discard: POST /v1/messages/{messageId}/discard
Discard a held message.
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(message_id: str, body: models.RiskFeedback) -> models.MessageSends messages.feedback: POST /v1/messages/{messageId}/feedback
Mark a message safe or unsafe.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.messages.release
client.messages.release(message_id: str) -> models.MessageSends messages.release: POST /v1/messages/{messageId}/release
Release a held message.
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(*, inbox_id: str | None = None, limit: int | None = None, offset: int | None = None) -> models.SecurityAuditPageSends security.audit: GET /v1/security/audit
Read the security audit log.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.security.iterate_audit
client.security.iterate_audit(*, inbox_id: str | None = None, limit: int | None = None, offset: int | None = None) -> Iterator[models.SecurityAuditEntry]Every item of client.security.audit, one page at a time: the next page is asked for when the loop reaches it. A page that does not advance raises ApiError.
client.security.get
client.security.get() -> models.SecuritySettingsSends security.get: GET /v1/security
Read the security policy.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.security.preview
client.security.preview(body: models.SecurityPreviewRequest) -> models.SecurityPreviewSends security.preview: POST /v1/security/preview
Preview what a policy does to a message.
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: models.UpdateSecurityPolicy) -> models.SecuritySettingsSends security.update: PATCH /v1/security
Change the security policy.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.sender_rules.create
client.sender_rules.create(body: models.CreateSenderRule) -> models.SenderRuleSends senderRules.create: POST /v1/sender-rules
Trust or block a sender.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.sender_rules.delete
client.sender_rules.delete(sender_rule_id: str) -> NoneSends senderRules.delete: DELETE /v1/sender-rules/{senderRuleId}
Remove a sender rule.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.sender_rules.list
client.sender_rules.list(*, inbox_id: str | None = None, standing: Literal['trusted', 'blocked'] | None = None, q: str | None = None, limit: int | None = None, offset: int | None = None) -> models.SenderRulePageSends senderRules.list: GET /v1/sender-rules
List sender rules.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.sender_rules.iterate
client.sender_rules.iterate(*, inbox_id: str | None = None, standing: Literal['trusted', 'blocked'] | None = None, q: str | None = None, limit: int | None = None, offset: int | None = None) -> Iterator[models.SenderRule]Every item of client.sender_rules.list, one page at a time: the next page is asked for when the loop reaches it. A page that does not advance raises ApiError.

