Webhooks

envless.webhooks.list_all()

Collect every webhook endpoint into one list

def list_all(
    *,
    limit: int | None = None,
    offset: int | None = None,
    search: str | None = None,
    order: str | None = None,
    timeout: float | None = None,
) -> list[WebhookResource]

Walks the pages and returns a flat list of every live endpoint. The 20 endpoint cap means this is a single request in practice, which makes it the normal way to load a settings screen.

The pagination envelope is dropped, so totalCount and hasMore are gone. Secrets are still absent from every row, so use create or rotate_secret if you need a usable secret rather than secretLastFour.

Example

from envless import envless

hooks = envless.webhooks.list_all()

unhealthy = [
    hook
    for hook in hooks
    if hook['enabled'] and hook['lastFailureAt'] is not None
]

print(
    [
        (hook['id'], hook['lastSuccessAt'])
        for hook in unhealthy
    ]
)

Parameters

ParameterTypeRequiredDescription
limitintNoPage size used while walking, capped at 100 and defaulting to 100.
offsetintNoRow the walk starts from, so earlier endpoints are left out of the result.
searchstrNoCase insensitive substring match applied to every page.
orderstrNoDefaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt.
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

list[WebhookResource] holding each live endpoint in the workspace.

Reads the webhooks collection. list returns one page as a dict with items and pagination, list_all collects every page into a list, and iterate yields one item at a time, fetching the next page only when the loop reaches it. On AsyncEnvless, iterate is an async iterator for async for.

Worth knowing

  • A failure on any page fails the whole call and the rows already collected are lost.
  • Refused for project fenced keys, like every other method here.

Required scopes

webhooks:read

Underlying endpoint

GET /webhooks

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

In TypeScript

envless.webhooks.listAll()

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