Webhooks

Envless.webhooks.get_delivery

Read one delivery attempt with its response body

def get_delivery(id, delivery_id, timeout: nil)

Returns one delivery attempt in full, including responseBody, which is what your receiver actually wrote back, truncated at 4000 characters. That field is the only thing this adds over the list rows, and it is normally what tells you why a receiver rejected the call.

Both ids must line up. A real delivery id passed under the wrong endpoint id is 404 webhook.delivery_not_found, not the delivery, so swapping the two arguments fails as a lookup rather than as validation.

error is populated for anything the worker treated as a failure, which includes a receiver that answered 3xx, since redirects are never followed, and one that took longer than the 10 second timeout. After 5 attempts the delivery is terminal and will not move again on its own.

Example

ruby
require "envless/sdk"

delivery = Envless.webhooks.get_delivery(
  "0194f2b1-9c3a-7c21-8f0e-2b6d4a1c5e90",
  "0194f2c8-11ad-7a03-b6c2-9d70f4e8a112"
)

puts "#{delivery[:attempts]} #{delivery[:responseStatus]}"
puts delivery[:responseBody]

Parameters

ParameterTypeRequiredDescription
idStringYesEndpoint id that owns the delivery.
delivery_idStringYesDelivery id from a list call or from the Envless-Delivery header your receiver saw.
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

webhook_delivery_detail_resource, the list row plus responseBody.

Worth knowing

  • The first argument is the endpoint id and the second is the delivery id.
  • responseBody is nil when the attempt never got a response at all, such as a timeout or a DNS failure.

Required scopes

webhooks:read

Underlying endpoint

GET /webhooks/{id}/deliveries/{deliveryId}

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

In TypeScript

envless.webhooks.getDelivery()

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