Ping a webhook
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping', 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://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping"
req, _ := http.NewRequest("POST", 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.post("https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyWebhooks
Ping a webhook
Send a signed test event and see how your endpoint responds.
POST
/
api
/
v2
/
webhooks
/
{webhook_id}
/
ping
Ping a webhook
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping', 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://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping"
req, _ := http.NewRequest("POST", 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.post("https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}/ping")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySends a signed
ping event to the webhook through the real delivery path (same signature headers, same URL safety checks) and returns your endpoint’s HTTP response synchronously.
The ping body has the standard event envelope with "type": "ping" and "data": {"webhook_id": "..."}. Pings bypass enabled_events filtering and are not retried.
Returns response_status, the HTTP status code your endpoint answered with.
Path parameters
string
required
The webhook’s
id (UUID).Examples
curl -X POST https://agp.eu.hcompany.ai/api/v2/webhooks/f47ac10b-58cc-4372-a567-0e02b2c3d479/ping \
-H "Authorization: Bearer $HAI_API_KEY"
from hai_agents import Client
client = Client()
result = client.webhooks.ping_webhook(webhook_id="f47ac10b-58cc-4372-a567-0e02b2c3d479")
print(result.response_status) # 200 if your endpoint accepted the ping
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const result = await client.webhooks.pingWebhook({ webhookId: "f47ac10b-58cc-4372-a567-0e02b2c3d479" });
console.log(result.responseStatus); // 200 if your endpoint accepted the ping
Response
{
"response_status": 200
}
Errors
| Status | Cause |
|---|---|
400 | The webhook URL is not https:// or does not resolve to a public address. |
404 | Webhook not found or you don’t have access. |
502 | The endpoint could not be reached (connection error or timeout). |
Was this page helpful?