Skip to content

client.webhook_endpoints

client.webhook_endpoints — the webhookEndpoints operations.

On AsyncKindgi every method is the same, awaited.

list(
*,
limit: int | None = None,
cursor: str | None = None,
timeout: float | None = None,
) -> WebhookEndpointCollectionPage

List webhook endpoints. GET /v1/webhook-endpoints

create(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> WebhookEndpoint

Register a webhook endpoint. POST /v1/webhook-endpoints

Registers a URL the platform sends signed events to. The signing secret is shared with the receiver, so it lives in your secrets (.env in development, the secrets store in production) and the endpoint references it by name (secretRef). Store it first; POST /v1/webhook-endpoints/generate-secret makes a strong one. Deliveries are signed in the Standard Webhooks format (webhook-id, webhook-timestamp, webhook-signature); verify with verifyWebhook from @kindgi/crypto or any Standard Webhooks library. The event bodies are described under webhooks in this document.

client.webhook_endpoints.generate_secret()

Section titled “client.webhook_endpoints.generate_secret()”
generate_secret(*, timeout: float | None = None) -> GeneratedWebhookSecret

Generate a webhook signing secret. POST /v1/webhook-endpoints/generate-secret

Returns a new strong secret (whsec_ + base64 of 32 random bytes). Nothing is stored: put it in your secrets, then register the endpoint with its name.

get(*, timeout: float | None = None) -> WebhookEndpoint

Fetch a webhook endpoint. GET /v1/webhook-endpoints/{endpointId}

update(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> WebhookEndpoint

Update a webhook endpoint. PATCH /v1/webhook-endpoints/{endpointId}

To rotate the signing secret, rotate the secret in your secrets store (POST /v1/secrets/{name}/rotate); point secretRef at another secret to switch.

unregister(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
) -> WebhookEndpointUnregisterResult

Unregister a webhook endpoint (soft delete). POST /v1/webhook-endpoints/{endpointId}/unregister

The endpoint stops receiving events; its pending deliveries are abandoned (failed). Idempotent.

client.webhook_endpoints.list_deliveries()

Section titled “client.webhook_endpoints.list_deliveries()”
list_deliveries(
*,
status: Literal['pending', 'delivered', 'failed'] | None = None,
limit: int | None = None,
cursor: str | None = None,
timeout: float | None = None,
) -> WebhookDeliveryCollectionPage

List a webhook endpoint's deliveries. GET /v1/webhook-endpoints/{endpointId}/deliveries

Newest first. Each delivery carries the event it delivers.

redeliver(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
) -> WebhookDelivery

Redeliver an event. POST /v1/webhook-endpoints/{endpointId}/deliveries/{deliveryId}/redeliver

Queues the delivery again now, whatever its status; its attempts start over.

send_test(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
) -> WebhookDelivery

Send a test event to a webhook endpoint. POST /v1/webhook-endpoints/{endpointId}/test

Queues a webhook.test event, signed like any other, to check the receiver end to end. Follow it in the delivery log.