Webhooks

envless.webhooks.delete()

Delete an endpoint and its delivery history

def delete(
    id: str,
    *,
    timeout: float | None = None,
) -> DeletedWebhookResource

Soft-deletes the endpoint. It leaves list, every other method here answers 404 for it, and the id is never reused. The signing secret is destroyed with the row and the delivery history goes with it, so export anything you need for an audit trail before you call this.

There is no undo. If the goal is only to stop deliveries, call update with 'enabled': False instead and keep the secret and the log.

One ordering quirk to expect: webhook.deleted is emitted before the row is removed, so an endpoint subscribed to webhook.deleted gets a delivery queued for its own deletion, which the worker then marks failed because the endpoint is already gone. That failure is normal and not a fault in your receiver.

Example

from envless import envless

audit = envless.webhooks.list_all_deliveries(
    '0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90'
)

deleted = envless.webhooks.delete(
    '0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90'
)

print(len(audit), deleted['deleted'])

Parameters

ParameterTypeRequiredDescription
idstrYesEndpoint id, ids only and no slug form.
timeoutfloatNoSeconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off.

Returns

DeletedWebhookResource with the id and a deleted flag.

Worth knowing

  • Not idempotent: a second call on the same id is 404 webhook.not_found.
  • Deleting frees a slot against the 20 endpoint cap immediately.

Required scopes

webhooks:write

Underlying endpoint

DELETE /webhooks/{id}

Request and response schema, every error code, and a live playground.

In TypeScript

envless.webhooks.delete()

The same method in @goenvless/sdk, with the same request, retries and errors.