Skip to main content
GET
/
v1
/
triggers
/
{triggerId}
/
wait
Consume the next events for an agent trigger subscription (short-poll)
curl --request GET \
  --url https://api.webhook.co/v1/triggers/{triggerId}/wait \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.webhook.co/v1/triggers/{triggerId}/wait"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.webhook.co/v1/triggers/{triggerId}/wait', 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.webhook.co/v1/triggers/{triggerId}/wait",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.webhook.co/v1/triggers/{triggerId}/wait"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.webhook.co/v1/triggers/{triggerId}/wait")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.webhook.co/v1/triggers/{triggerId}/wait")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "events": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "endpointId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "receivedAt": "2023-11-07T05:31:56Z",
      "dedupKey": "<string>",
      "verified": true,
      "vouched": true,
      "body": "<string>",
      "bodyTruncated": true,
      "contentType": "<string>"
    }
  ],
  "nextCursor": "<string>",
  "caughtUp": true
}
{
"error": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}
"<string>"

Authorizations

Authorization
string
header
required

A whk_-prefixed API key (opaque; not a JWT).

Path Parameters

triggerId
string<uuid>
required
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Query Parameters

cursor
string | null

Opaque resume cursor from a prior call's nextCursor.

limit
integer

Max events to return (1–200).

Required range: x <= 200
includeBody
boolean

Attach the bounded inline event body to each event (default true).

maxBodyBytes
integer

Per-event inline body byte cap (server-capped at 65536).

Required range: x <= 65536

Response

Success.

events
object[]
required
nextCursor
string | null
required
caughtUp
boolean
required