TypeScript SDK: Inboxes
The methods of the TypeScript client under Inboxes. Addresses on the inbox domain: issue, read, rename and delete them.
client.inboxes.list
client.inboxes.list(params: ListInboxesParams = {}): Promise<InboxPage>Sends inboxes.list: GET /v1/inboxes
The account's active inboxes, oldest first. An inbox-scoped key sees its own inbox only.
Access any: any API key, or a console session. An app token needs inboxes:read.
client.inboxes.iterate
client.inboxes.iterate(params: ListInboxesParams = {}): AsyncGenerator<InboxListItem, void, undefined>Every inbox of the account, page by page.
client.inboxes.findByExternalId
client.inboxes.findByExternalId(externalId: string): Promise<InboxListItem | null>The inbox tagged with this externalId, or null.
client.inboxes.create
client.inboxes.create(body: CreateInbox = {}): Promise<CreatedInbox>Sends inboxes.create: POST /v1/inboxes
A new address that receives mail as soon as the call returns. With webhookUrl and key, the answer carries the webhook's signing secret and the inbox-scoped key's token, once.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs inboxes:write.
client.inboxes.get
client.inboxes.get(inboxId: string): Promise<Inbox>Sends inboxes.get: GET /v1/inboxes/{inboxId}
One inbox.
Access any: any API key, or a console session. An app token needs inboxes:read.
client.inboxes.update
client.inboxes.update(inboxId: string, body: UpdateInbox): Promise<Inbox>Sends inboxes.update: PATCH /v1/inboxes/{inboxId}
Display name, external identifier or replacement metadata. Omitted fields are preserved.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs inboxes:write.
client.inboxes.delete
client.inboxes.delete(inboxId: string): Promise<void>Sends inboxes.delete: DELETE /v1/inboxes/{inboxId}
Releases the address, revokes the inbox's keys, removes its webhook and stops delivery.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs inboxes:write.
client.inboxes.rules.list
client.inboxes.rules.list(inboxId: string): Promise<RuleList>Sends inboxes.rules.list: GET /v1/inboxes/{inboxId}/rules
Active rules in execution order, oldest first.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs rules:manage and mail:read and mail:write and mail:send.
client.inboxes.rules.create
client.inboxes.rules.create(inboxId: string, body: CreateRule): Promise<Rule>Sends inboxes.rules.create: POST /v1/inboxes/{inboxId}/rules
A bounded rule, enabled by default.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs rules:manage and mail:read and mail:write and mail:send.
client.inboxes.rules.get
client.inboxes.rules.get(inboxId: string, ruleId: string): Promise<Rule>Sends inboxes.rules.get: GET /v1/inboxes/{inboxId}/rules/{ruleId}
One active rule.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs rules:manage and mail:read and mail:write and mail:send.
client.inboxes.rules.update
client.inboxes.rules.update(inboxId: string, ruleId: string, body: UpdateRule): Promise<Rule>Sends inboxes.rules.update: PATCH /v1/inboxes/{inboxId}/rules/{ruleId}
Replace supplied fields and cancel pending snapshots of the old revision.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs rules:manage and mail:read and mail:write and mail:send.
client.inboxes.rules.delete
client.inboxes.rules.delete(inboxId: string, ruleId: string): Promise<void>Sends inboxes.rules.delete: DELETE /v1/inboxes/{inboxId}/rules/{ruleId}
Soft-delete the rule and cancel its pending snapshots.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs rules:manage and mail:read and mail:write and mail:send.
client.inboxes.rules.runs
client.inboxes.rules.runs(inboxId: string, ruleId: string, params: PageParams = {}): Promise<RuleRunPage>Sends inboxes.rules.runs: GET /v1/inboxes/{inboxId}/rules/{ruleId}/runs
Execution history, newest first. Uncertain mail is never retried automatically.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs rules:manage and mail:read and mail:write and mail:send.
client.inboxes.rules.iterateRuns
client.inboxes.rules.iterateRuns(inboxId: string, ruleId: string, params: PageParams = {}): AsyncGenerator<RuleRun, void, undefined>Every run of a rule, newest first, page by page.

