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

TypeScript

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

TypeScript

client.inboxes.iterate(params: ListInboxesParams = {}): AsyncGenerator<InboxListItem, void, undefined>

Every inbox of the account, page by page.

client.inboxes.findByExternalId

TypeScript

client.inboxes.findByExternalId(externalId: string): Promise<InboxListItem | null>

The inbox tagged with this externalId, or null.

client.inboxes.create

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

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

TypeScript

client.inboxes.rules.iterateRuns(inboxId: string, ruleId: string, params: PageParams = {}): AsyncGenerator<RuleRun, void, undefined>

Every run of a rule, newest first, page by page.

Up Down to move, Enter to open, Esc to close