Send a test event to a webhook
method
POST
host
strait.
version
/v1
resource
/
POST /v1/webhooks/{id}/test
Auth: secret key as Authorization: Bearer. Server-side only.
Request
Delivers a ping event to the webhook right now (even if paused) and returns the receiver's HTTP status and the time it took (never its response body). Not stored or retried. Every delivery is signed: X-Strait-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" with the webhook secret> — recompute it and refuse timestamps more than 5 minutes old. It is the only signature header. Other headers: X-Strait-Event, X-Strait-Delivery (stable across retries — de-duplicate on it), X-Strait-Attempt. Events: link.clicked, app.opened, install.matched, referral.converted and app.event (POST /v1/event). Webhook URLs must be public https endpoints: private, loopback, link-local and CGNAT addresses are refused when saved and again at every delivery, when the connection is made (after DNS resolution).
Parameters
idrequired string path- The webhook id (Dashboard → Settings → Webhooks)
Response
- 200 The attempt (delivered or not)
- 401 Missing or invalid secret key
- 404 No such webhook in the key's workspace
curl -X POST https://strait.link/v1/webhooks/<webhook id>/test \
-H "Authorization: Bearer $SECRET_KEY"const res = await fetch('https://strait.link/v1/webhooks/<webhook id>/test', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.SECRET_KEY}` },
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.post(
"https://strait.link/v1/webhooks/<webhook id>/test",
headers={"Authorization": f"Bearer {os.environ['SECRET_KEY']}"},
)
print(res.status_code, res.json())<?php
// Plain PHP with ext-curl, no packages. In Laravel, Http::withToken($secretKey)->post($url) sends the same request.
$ch = curl_init('https://strait.link/v1/webhooks/<webhook id>/test');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SECRET_KEY'),
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL;
print_r(json_decode($response, true));import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
// Java 17+, java.net.http only (no dependencies).
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://strait.link/v1/webhooks/<webhook id>/test"))
.header("Authorization", "Bearer " + System.getenv("SECRET_KEY"))
.POST(HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());
}
}package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(http.MethodPost, "https://strait.link/v1/webhooks/<webhook id>/test", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SECRET_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(res.StatusCode, string(data))
}The response, printed
{
"delivered": true,
"status": 204,
"error": null,
"body": "",
"durationMs": 182,
"deliveryId": "0b9c3f0e-5a7d-4a51-9a2e-3f1c8d2b6e47",
"event": "ping"
}