Skip to main content
GET
/
api
/
v1
/
waitpoints
/
tokens
/
{waitpointId}
TypeScript
import { wait } from "@trigger.dev/sdk";

const token = await wait.retrieveToken("waitpoint_abc123");

console.log(token.status); // "WAITING" | "COMPLETED" | "TIMED_OUT"

if (token.status === "COMPLETED") {
  console.log(token.output);
}
{
  "id": "waitpoint_abc123",
  "url": "https://api.trigger.dev/api/v1/waitpoints/tokens/waitpoint_abc123/callback/abc123hash",
  "status": "WAITING",
  "tags": [
    "<string>"
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "idempotencyKey": "<string>",
  "idempotencyKeyExpiresAt": "2023-11-07T05:31:56Z",
  "timeoutAt": "2023-11-07T05:31:56Z",
  "completedAt": "2023-11-07T05:31:56Z",
  "output": "<string>",
  "outputType": "<string>",
  "outputIsError": true
}

Authorizations

Authorization
string
header
required

Use your project-specific Secret API key. Will start with tr_dev_, tr_prod, tr_stg, etc.

You can find your Secret API key in the API Keys section of your Trigger.dev project dashboard.

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.

import { configure } from "@trigger.dev/sdk";

configure({ accessToken: "tr_dev_1234" });

Path Parameters

waitpointId
string
required

The ID of the waitpoint token.

Response

Successful request

id
string
required

The unique ID of the waitpoint token.

Example:

"waitpoint_abc123"

url
string
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:

"https://api.trigger.dev/api/v1/waitpoints/tokens/waitpoint_abc123/callback/abc123hash"

status
enum<string>
required

The current status of the waitpoint token.

Available options:
WAITING,
COMPLETED,
TIMED_OUT
tags
string[]
required

Tags attached to the waitpoint.

createdAt
string<date-time>
required

When the waitpoint token was created.

idempotencyKey
string | null

The idempotency key used when creating the token, if any.

idempotencyKeyExpiresAt
string<date-time> | null

When the idempotency key expires.

timeoutAt
string<date-time> | null

When the token will time out, if a timeout was set.

completedAt
string<date-time> | null

When the token was completed, if it has been completed.

output
string | null

The serialized output data passed when completing the token. Only present when status is COMPLETED.

outputType
string | null

The content type of the output (e.g. "application/json").

outputIsError
boolean | null

Whether the output represents an error (e.g. a timeout).