Waitpoints API
Complete a waitpoint token via HTTP callback
Completes a waitpoint token using the pre-signed callback URL returned in the url field when the token was created. No API key is required — the callbackHash in the URL acts as the authentication token.
This is designed to be given directly to external services (e.g. as a webhook URL) so they can unblock a waiting run without needing access to your API key. The entire request body is passed as the output data to the waiting run.
If the token is already completed, this is a no-op and returns success: true.
POST
/
api
/
v1
/
waitpoints
/
tokens
/
{waitpointId}
/
callback
/
{callbackHash}
cURL
# The full URL is returned as `url` when you create a token
curl -X POST "https://api.trigger.dev/api/v1/waitpoints/tokens/waitpoint_abc123/callback/abc123hash" \
-H "Content-Type: application/json" \
-d '{"status": "approved", "comment": "Looks good to me!"}'import { wait } from "@trigger.dev/sdk";
// In your task: create the token and send the URL to an external service
const token = await wait.createToken({ timeout: "1h" });
await sendApprovalRequestEmail({
callbackUrl: token.url, // give this URL to the external service
});
// The external service POSTs to token.url to unblock the run
const result = await wait.forToken<{ status: string }>(token);import requests
url = "https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}"
payload = {
"status": "approved",
"comment": "Looks good to me!"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({status: 'approved', comment: 'Looks good to me!'})
};
fetch('https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'approved',
'comment' => 'Looks good to me!'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}"
payload := strings.NewReader("{\n \"status\": \"approved\",\n \"comment\": \"Looks good to me!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"approved\",\n \"comment\": \"Looks good to me!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"approved\",\n \"comment\": \"Looks good to me!\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Path Parameters
Body
application/json
Any JSON object. The entire body is passed as the output data to the run waiting on this token. If the body is not valid JSON, an empty object is used.
Was this page helpful?
⌘I
cURL
# The full URL is returned as `url` when you create a token
curl -X POST "https://api.trigger.dev/api/v1/waitpoints/tokens/waitpoint_abc123/callback/abc123hash" \
-H "Content-Type: application/json" \
-d '{"status": "approved", "comment": "Looks good to me!"}'import { wait } from "@trigger.dev/sdk";
// In your task: create the token and send the URL to an external service
const token = await wait.createToken({ timeout: "1h" });
await sendApprovalRequestEmail({
callbackUrl: token.url, // give this URL to the external service
});
// The external service POSTs to token.url to unblock the run
const result = await wait.forToken<{ status: string }>(token);import requests
url = "https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}"
payload = {
"status": "approved",
"comment": "Looks good to me!"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({status: 'approved', comment: 'Looks good to me!'})
};
fetch('https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'approved',
'comment' => 'Looks good to me!'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}"
payload := strings.NewReader("{\n \"status\": \"approved\",\n \"comment\": \"Looks good to me!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"approved\",\n \"comment\": \"Looks good to me!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trigger.dev/api/v1/waitpoints/tokens/{waitpointId}/callback/{callbackHash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"approved\",\n \"comment\": \"Looks good to me!\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}
