Webhooks

Envless.webhooks.list_deliveries

List delivery attempts for one endpoint

def list_deliveries(id, limit: nil, offset: nil, status: nil, timeout: nil)

Returns one page of delivery attempts for a single endpoint, newest first. This is the log you read when a receiver stops seeing events.

A delivery starts pending, moves to processing, then settles as succeeded or failed. attempts counts tries so far up to 5, while responseStatus and error record what the receiver said. Anything outside 2xx, a 3xx redirect, or a request past the 10 second timeout is a failure. Use status: to narrow the log to one state, and note that an unrecognised value is a 400 rather than an empty page.

Response bodies are omitted from every row here. get_delivery is the only way to see responseBody, and that is usually the field that explains a failure.

Example

ruby
require "envless/sdk"

endpoint_id = "0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90"
page = Envless.webhooks.list_deliveries(
  endpoint_id,
  status: "failed",
  limit: 25
)

page.items.each do |delivery|
  puts "#{delivery[:eventType]} #{delivery[:responseStatus]}"
  puts delivery[:attempts]
end

Parameters

ParameterTypeRequiredDescription
idStringYesEndpoint id, only its own deliveries are returned.
status:"pending" | "processing" | "succeeded" | "failed"NoRestricts the page to one delivery state such as failed.
limit:IntegerNoRows per page, a whole number from 1 to 100.
offset:IntegerNoWhole number of deliveries to skip before the page starts.
timeout:Integer | Float | RationalNoSeconds 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

Page[webhook_delivery_resource] with items and a pagination envelope counting the matching deliveries.

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

  • One event fanned out to several endpoints produces several deliveries, and a redelivery reuses the source event id, so the event id is not unique. De-duplicate on it in your handler.
  • A 404 webhook.not_found means the endpoint id is wrong, not that the log is empty.

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.listDeliveries()

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