def iterate_deliveries(
id,
limit: nil,
offset: nil,
status: nil,
timeout: nil,
&block
)def iterate_deliveries: (
String id,
?limit: Integer?,
?offset: Integer?,
?status: ("pending" | "processing" | "succeeded" | "failed")?,
?timeout: seconds?
) -> Enumerator[webhook_delivery_resource, nil]
| (
String id,
?limit: Integer?,
?offset: Integer?,
?status: ("pending" | "processing" | "succeeded" | "failed")?,
?timeout: seconds?
) { (webhook_delivery_resource) -> void } -> nilReturns an Enumerator 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
require "envless/sdk"
endpoint_id = "0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90"
Envless.webhooks.iterate_deliveries(endpoint_id) do |delivery|
if delivery[:status] == "failed"
puts "#{delivery[:id]} #{delivery[:responseStatus]}"
puts delivery[:error]
break
end
endParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | Endpoint id whose delivery log is streamed. |
status: | "pending" | "processing" | "succeeded" | "failed" | No | Restricts the stream to one delivery state such as pending. |
limit: | Integer | No | Page size per request, capped at 100 and defaulting to 100. |
offset: | Integer | No | Row the walk starts at, advancing by the number of items each page returns. |
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
Enumerator[webhook_delivery_resource, nil] yielding one delivery attempt per step.
Reads the deliveries collection. list returns one page as an Envless::Page with items and pagination, list_all collects every page into an array, and iterate yields one item at a time to a block, fetching the next page only when it gets there. Without a block, iterate returns an Enumerator.
Worth knowing
- The
Enumeratoris 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.