def delete(id, timeout: nil)def delete: (String id, ?timeout: seconds?) -> deleted_webhook_resourceSoft-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
require "envless/sdk"
endpoint_id = "0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90"
audit = Envless.webhooks.list_all_deliveries(endpoint_id)
deleted = Envless.webhooks.delete(endpoint_id)
puts "#{audit.size} #{deleted[:deleted]}"Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | Endpoint id, ids only and no slug form. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
deleted_webhook_resource 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.