def iterate_deliveries(
id: str,
*,
limit: int | None = None,
offset: int | None = None,
status: str | None = None,
timeout: float | None = None,
) -> Iterator[WebhookDeliveryResource]def iterate_deliveries(
id: str,
*,
limit: int | None = None,
offset: int | None = None,
status: str | None = None,
timeout: float | None = None,
) -> AsyncIterator[WebhookDeliveryResource]Returns an iterator over one endpoint delivery log, fetching the next page only when the current one is drained. Breaking out stops the requests, which is what makes this the right tool for scanning a large log until you hit the first failure.
The ordering is newest first, so new deliveries land at the top of the set the offsets are counted against while you walk. A row can therefore repeat across pages on an active endpoint: de-duplicate on the delivery id if exactness matters. limit is clamped to 100 and only ever makes pages smaller.
Example
from envless import envless
for delivery in envless.webhooks.iterate_deliveries(
'0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90'
):
if delivery['status'] == 'failed':
print(
delivery['id'],
delivery['responseStatus'],
delivery['error'],
)
breakimport asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
async for delivery in envless.webhooks.iterate_deliveries(
'0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90'
):
if delivery['status'] == 'failed':
print(
delivery['id'],
delivery['responseStatus'],
delivery['error'],
)
break
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | str | Yes | Endpoint id whose delivery log is streamed. |
status | str | No | Restricts the stream to one delivery state such as pending. |
limit | int | No | Page size per request, capped at 100 and defaulting to 100. |
offset | int | No | Row the walk starts at, advancing by the number of items each page returns. |
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
Iterator[WebhookDeliveryResource] yielding one delivery attempt per step.
Reads the deliveries 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
- The generator is lazy, so no request is sent until you start consuming it.
- Rows yielded here never carry
responseBody, follow up withget_deliveryfor the one you care about.
Required scopes
webhooks:read
Underlying endpoint
GET /webhooks/{id}/deliveries
Request and response schema, every error code, and a live playground.
In TypeScript
envless.webhooks.iterateDeliveries()
The same method in @goenvless/sdk, with the same request, retries and errors.