/** @return DeletedWebhookResource */
public function delete(string $id, int|float|null $timeout = null): arraySoft-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
use Envless\Envless;
$envless = new Envless();
$endpointId = '0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90';
$audit = $envless->webhooks->listAllDeliveries($endpointId);
$deleted = $envless->webhooks->delete($endpointId);
echo count($audit), $deleted['deleted'] ? ' deleted' : '', PHP_EOL;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
$id | string | Yes | Endpoint id, ids only and no slug form. |
$timeout | int|float | No | Seconds each attempt of this call may take, the response body included, before it throws Envless\Exception\NetworkException with isTimeout() true. 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.