v1

latestOpenAPI 3.1.0Apache 2.0raw.githubusercontent.com2026-05-044743166.6 KB
waitpoints

Create a waitpoint token

Creates a new waitpoint token that can be used to pause a run until an external event completes it. The token includes a url which can be called via HTTP POST to complete the waitpoint. Use the token ID with wait.forToken() inside a task to pause execution until the token is completed.

post/api/v1/waitpoints/tokens

Request body

idempotencyKeystring

An optional idempotency key. If you pass the same key twice before it expires, you will receive the original token back. The returned token may already be completed, in which case wait.forToken() will continue immediately.

idempotencyKeyTTLstring

How long the idempotency key is valid, after which passing the same key creates a new waitpoint. Accepts durations like "30s", "1m", "2h", "3d".

timeoutstring

How long to wait before the token times out. When a run is waiting for a timed-out token, wait.forToken() returns with ok: false. Accepts an ISO 8601 date string or duration shorthand like "30s", "1m", "2h", "3d", "4w".

Example request

{
  "idempotencyKey": "approval-user-1234567",
  "idempotencyKeyTTL": "1h",
  "timeout": "1h"
}

Response

Waitpoint token created successfully

idstring required

The unique ID of the waitpoint token.

isCachedboolean required

true if an existing token was returned because the same idempotencyKey was used within its TTL window.

urlstring required

An HTTP callback URL. A POST request to this URL (with an optional JSON body) will complete the waitpoint without needing an API key.

Example response

{
  "id": "waitpoint_abc123",
  "url": "https://api.trigger.dev/api/v1/waitpoints/tokens/waitpoint_abc123/callback/abc123hash"
}