Python SDK: Webhooks

The methods of the Python client under Webhooks. The inbox webhook, account endpoints, their signed deliveries and the delivery log.

client.deliveries.retry

Python

client.deliveries.retry(delivery_id: str) -> models.Delivery

Sends deliveries.retry: POST /v1/deliveries/{deliveryId}/retry

Retry a delivery.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.inboxes.webhook.delete

Python

client.inboxes.webhook.delete(inbox_id: str) -> None

Sends inboxes.webhook.delete: DELETE /v1/inboxes/{inboxId}/webhook

Remove the inbox webhook.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

client.inboxes.webhook.deliveries

Python

client.inboxes.webhook.deliveries(inbox_id: str, *, limit: int | None = None, cursor: str | None = None) -> models.DeliveryPage

Sends inboxes.webhook.deliveries: GET /v1/inboxes/{inboxId}/webhook/deliveries

List the inbox webhook's deliveries.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

client.inboxes.webhook.iterate_deliveries

Python

client.inboxes.webhook.iterate_deliveries(inbox_id: str, *, limit: int | None = None, cursor: str | None = None) -> Iterator[models.Delivery]

Every item of client.inboxes.webhook.deliveries, 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.webhook.get

Python

client.inboxes.webhook.get(inbox_id: str) -> models.InboxWebhook

Sends inboxes.webhook.get: GET /v1/inboxes/{inboxId}/webhook

Read the inbox webhook.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

client.inboxes.webhook.rotate_secret

Python

client.inboxes.webhook.rotate_secret(inbox_id: str) -> models.InboxWebhookSecret

Sends inboxes.webhook.rotateSecret: POST /v1/inboxes/{inboxId}/webhook/rotate-secret

Rotate the inbox webhook's secret.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

client.inboxes.webhook.set

Python

client.inboxes.webhook.set(inbox_id: str, body: models.SetInboxWebhook) -> models.InboxWebhookSecret

Sends inboxes.webhook.set: PUT /v1/inboxes/{inboxId}/webhook

Set the inbox webhook.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

client.webhooks.create

Python

client.webhooks.create(body: models.CreateEndpoint) -> models.CreatedEndpoint

Sends webhooks.create: POST /v1/webhooks

Create an endpoint.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.webhooks.delete

Python

client.webhooks.delete(endpoint_id: str) -> None

Sends webhooks.delete: DELETE /v1/webhooks/{endpointId}

Delete an endpoint.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.webhooks.deliveries

Python

client.webhooks.deliveries(endpoint_id: str, *, limit: int | None = None, cursor: str | None = None) -> models.DeliveryPage

Sends webhooks.deliveries: GET /v1/webhooks/{endpointId}/deliveries

List an endpoint's deliveries.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.webhooks.iterate_deliveries

Python

client.webhooks.iterate_deliveries(endpoint_id: str, *, limit: int | None = None, cursor: str | None = None) -> Iterator[models.Delivery]

Every item of client.webhooks.deliveries, 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.webhooks.get

Python

client.webhooks.get(endpoint_id: str) -> models.Endpoint

Sends webhooks.get: GET /v1/webhooks/{endpointId}

Read an endpoint.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.webhooks.list

Python

client.webhooks.list() -> models.EndpointList

Sends webhooks.list: GET /v1/webhooks

List endpoints.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.webhooks.rotate_secret

Python

client.webhooks.rotate_secret(endpoint_id: str) -> models.EndpointSecret

Sends webhooks.rotateSecret: POST /v1/webhooks/{endpointId}/rotate-secret

Rotate an endpoint's secret.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.webhooks.test

Python

client.webhooks.test(endpoint_id: str) -> models.EndpointTestResult

Sends webhooks.test: POST /v1/webhooks/{endpointId}/test

Send a test delivery.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

client.webhooks.update

Python

client.webhooks.update(endpoint_id: str, body: models.UpdateEndpoint) -> models.Endpoint

Sends webhooks.update: PATCH /v1/webhooks/{endpointId}

Change an endpoint.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. An app token needs webhooks:manage and events:read and mail:read.

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