webhooks

Create a webhook waiter

Changed on

Create a waiter on an endpoint. A waiter is a waitpoint that completes when a matching delivery arrives on the endpoint, so a run waiting on its id resumes with the verified event. It only matches deliveries that arrive after it was created. Omit match to get a waiter with its own url, for providers that take a webhook URL per request.

post/api/v1/webhooks/endpoints/{endpointId}/waiters

Request

Request body

matchobject

Up to five paths, each mapped to the value it must equal. event.* reads the event body, header.* a request header (case-insensitive) and webhook.* the endpoint (id, source, externalRef, tenantId or deliveryId). Omit it to create a waiter with its own url.

filterstring

A filter the event must also pass, checked after match.

timeoutstring

A duration such as 30m or 1h, or an ISO 8601 date. Defaults to 24 hours, up to 90 days.

idempotencyKeystring

A create with a key already used in the environment returns the original waiter with isCached: true, even if it has completed.

idempotencyKeyTTLstring

How long the idempotency key lasts, such as 1h or 30d.

Example request

{
  "match": {
    "event.type": "payment_intent.succeeded",
    "event.data.object.metadata.orderId": "order_123"
  },
  "filter": "event.data.object.amount > 1000",
  "timeout": "1h"
}

Response

Waiter created, or the existing waiter for this idempotency key

idstring required

The waiter's id, which is also its waitpoint id. Wait on it with webhooks.waiter.wait() or wait.forToken().

urlstring

Only for a waiter created without match: the URL to give the provider as its per-request webhook. A delivery to it is verified with the endpoint's source and resumes only this waiter.

expiresAtstring date-time required

When the waiter times out.

isCachedboolean required

true if an existing waiter was returned for the same idempotencyKey.

Example response

{
  "id": "waitpoint_abc123"
}

Changes