Skip to main content
POST
TypeScript

Authorizations

Authorization
string
header
required

Use a named environment API key. It starts with tr_dev_sk_, tr_prod_sk_, tr_stg_sk_, etc.

Create a named API key in the API Keys section of your Trigger.dev project dashboard. Choose the narrowest access preset that supports your integration.

Our TypeScript SDK will default to using the value of the TRIGGER_SECRET_KEY environment variable if it is set. If you are using the SDK in a different environment, you can set the key using the configure function.

Path Parameters

endpointId
string
required

The endpoint's declared id (the id passed to webhooks.endpoint.define) or its wh_ id. A value starting with wh_ is always a generated id, since declared ids can't start with wh_. A declared id names the endpoint's declared instance in the key's environment.

Body

application/json
match
object

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.

Example:
filter
string

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

Example:

"event.data.object.amount > 1000"

timeout
string

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

Example:

"1h"

tags

Up to 10 tags, added to the webhook:<endpoint id> tag every waiter gets.

idempotencyKey
string

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

idempotencyKeyTTL
string

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

Response

Waiter created, or the existing waiter for this idempotency key

id
string
required

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

Example:

"waitpoint_abc123"

expiresAt
string<date-time>
required

When the waiter times out.

isCached
boolean
required

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

url
string

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.