Register a webhook endpoint
curl --request POST \
--url https://api.zebratruth.ai/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Recent-Auth-Proof: <x-recent-auth-proof>' \
--data '
{
"url": "<string>",
"events": [
"check.completed",
"check.failed"
]
}
'import requests
url = "https://api.zebratruth.ai/v1/webhooks"
payload = {
"url": "<string>",
"events": ["check.completed", "check.failed"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Recent-Auth-Proof": "<x-recent-auth-proof>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Recent-Auth-Proof': '<x-recent-auth-proof>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', events: ['check.completed', 'check.failed']})
};
fetch('https://api.zebratruth.ai/v1/webhooks', 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.zebratruth.ai/v1/webhooks",
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([
'url' => '<string>',
'events' => [
'check.completed',
'check.failed'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Recent-Auth-Proof: <x-recent-auth-proof>"
],
]);
$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.zebratruth.ai/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"check.completed\",\n \"check.failed\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Recent-Auth-Proof", "<x-recent-auth-proof>")
req.Header.Add("Authorization", "Bearer <token>")
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.zebratruth.ai/v1/webhooks")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Recent-Auth-Proof", "<x-recent-auth-proof>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"check.completed\",\n \"check.failed\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebratruth.ai/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Recent-Auth-Proof"] = '<x-recent-auth-proof>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"check.completed\",\n \"check.failed\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"webhookId": "<string>",
"secret": "whsec_0123456789abcdef0123456789abcdef",
"url": "<string>",
"events": [
"<string>"
],
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": true,
"url": "<string>",
"statusMessage": "<string>",
"data": {
"code": "review_scope_not_enabled"
}
}{
"statusCode": 123,
"message": "<string>",
"error": true,
"url": "<string>",
"statusMessage": "<string>",
"data": {
"code": "review_scope_not_enabled"
}
}{
"statusCode": 123,
"message": "<string>",
"error": true,
"url": "<string>",
"statusMessage": "<string>",
"data": {
"code": "review_scope_not_enabled"
}
}Webhooks
Register a webhook endpoint
Dashboard session only, owner role, with a recent-authentication proof
(X-Recent-Auth-Proof) and an Idempotency-Key. Returns the signing secret exactly
once. Deliveries carry X-ZebraTruth-Signature (sha256= HMAC-SHA256 of the raw body
with this secret), X-ZebraTruth-Timestamp and X-ZebraTruth-Event-Id; retries reuse
all three, so de-duplicate on the event id.
POST
/
webhooks
Register a webhook endpoint
curl --request POST \
--url https://api.zebratruth.ai/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Recent-Auth-Proof: <x-recent-auth-proof>' \
--data '
{
"url": "<string>",
"events": [
"check.completed",
"check.failed"
]
}
'import requests
url = "https://api.zebratruth.ai/v1/webhooks"
payload = {
"url": "<string>",
"events": ["check.completed", "check.failed"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Recent-Auth-Proof": "<x-recent-auth-proof>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Recent-Auth-Proof': '<x-recent-auth-proof>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', events: ['check.completed', 'check.failed']})
};
fetch('https://api.zebratruth.ai/v1/webhooks', 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.zebratruth.ai/v1/webhooks",
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([
'url' => '<string>',
'events' => [
'check.completed',
'check.failed'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Recent-Auth-Proof: <x-recent-auth-proof>"
],
]);
$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.zebratruth.ai/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"check.completed\",\n \"check.failed\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Recent-Auth-Proof", "<x-recent-auth-proof>")
req.Header.Add("Authorization", "Bearer <token>")
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.zebratruth.ai/v1/webhooks")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Recent-Auth-Proof", "<x-recent-auth-proof>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"check.completed\",\n \"check.failed\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebratruth.ai/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Recent-Auth-Proof"] = '<x-recent-auth-proof>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"check.completed\",\n \"check.failed\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"webhookId": "<string>",
"secret": "whsec_0123456789abcdef0123456789abcdef",
"url": "<string>",
"events": [
"<string>"
],
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": true,
"url": "<string>",
"statusMessage": "<string>",
"data": {
"code": "review_scope_not_enabled"
}
}{
"statusCode": 123,
"message": "<string>",
"error": true,
"url": "<string>",
"statusMessage": "<string>",
"data": {
"code": "review_scope_not_enabled"
}
}{
"statusCode": 123,
"message": "<string>",
"error": true,
"url": "<string>",
"statusMessage": "<string>",
"data": {
"code": "review_scope_not_enabled"
}
}Authorizations
API key starting with zt_live_ (production) or zt_test_ (sandbox).
Get your key at https://developers.zebratruth.ai
Headers
Unique request identifier to prevent duplicate execution and double-charging. Generate a new UUID for each distinct request. Reuse the same key to safely retry.
Body
application/json