def update(
id: str,
patch: WebhookPatch,
*,
timeout: float | None = None,
) -> WebhookResourceasync def update(
id: str,
patch: WebhookPatch,
*,
timeout: float | None = None,
) -> WebhookResourcePatches the name, URL, description, subscription set or enabled flag. At least one of those keys must be present: an empty dict is a 400, not a no-op. url is re-validated against the full https and public host ruleset on every change, and passing None or an empty string for description clears the note.
eventTypes replaces the subscription set wholesale, unlike scopes on keys.update, which merges. Send the complete list you want rather than a delta. It must stay non empty, so there is no way to subscribe to nothing: disable the endpoint instead.
Disabling does not drain the queue. Deliveries already queued are not cancelled, the worker picks them up, sees the endpoint is disabled and marks them failed with Endpoint disabled, so expect a burst of failures in the log right after you turn it off. Nothing new is queued while enabled is False, and events that occur during the downtime are lost to this endpoint rather than buffered.
Example
from envless import envless
updated = envless.webhooks.update(
'0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90',
{
'eventTypes': [
'variable.created',
'variable.updated',
'variable_version.created',
],
'enabled': True,
},
)
print(updated['eventTypes'])import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
updated = await envless.webhooks.update(
'0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90',
{
'eventTypes': [
'variable.created',
'variable.updated',
'variable_version.created',
],
'enabled': True,
},
)
print(updated['eventTypes'])
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | str | Yes | Endpoint id, ids only and no slug form. |
patch['url'] | str | No | Replacement https URL, re-validated against the full host ruleset. |
patch['eventTypes'] | list[str] | No | Complete replacement subscription set, which must stay non empty. |
patch['name'] | str | No | Replacement label, at most 64 characters and never blank: an empty string is a 400, not a way to clear it. |
patch['description'] | str | None | No | Replacement note, at most 200 characters, or empty to clear it. |
patch['enabled'] | bool | No | Set False to stop queuing new deliveries, must be a boolean. |
timeout | float | No | Seconds 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
WebhookResource reflecting the saved endpoint, still with secretLastFour in place of any secret.
Worth knowing
- The signing secret is untouched by this route, use
rotate_secretto change it. - Read the current
eventTypesfirst if you mean to add one, since a partial list silently unsubscribes the rest.
Required scopes
webhooks:write
Underlying endpoint
PATCH /webhooks/{id}
Request and response schema, every error code, and a live playground.
In TypeScript
envless.webhooks.update()
The same method in @goenvless/sdk, with the same request, retries and errors.