List event types
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/webhooks/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/webhooks/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/webhooks/events', 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/events",
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://agp.eu.hcompany.ai/api/v2/webhooks/events"
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://agp.eu.hcompany.ai/api/v2/webhooks/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/webhooks/events")
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{
"type": "<string>",
"description": "<string>"
}Webhooks
List event types
List the webhook event types you can subscribe to.
GET
/
api
/
v2
/
webhooks
/
events
List event types
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/webhooks/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/webhooks/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/webhooks/events', 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/events",
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://agp.eu.hcompany.ai/api/v2/webhooks/events"
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://agp.eu.hcompany.ai/api/v2/webhooks/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/webhooks/events")
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{
"type": "<string>",
"description": "<string>"
}Lists every concrete event type that can appear in a webhook’s
enabled_events, with a human-readable description. Use it to populate subscription UIs or to discover types added after you integrated.
Returns an array of event type definitions.
The event type definition object
The event type identifier, e.g.
session.completed.When the event is sent.
Examples
curl https://agp.eu.hcompany.ai/api/v2/webhooks/events \
-H "Authorization: Bearer $HAI_API_KEY"
from hai_agents import Client
client = Client()
for event in client.webhooks.list_webhook_events():
print(event.type, "-", event.description)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const events = await client.webhooks.listWebhookEvents();
for (const event of events) {
console.log(event.type, "-", event.description);
}
Response
[
{
"type": "session.awaiting_tool_results",
"description": "Sent when the agent is waiting for client-side tool results."
},
{
"type": "session.completed",
"description": "Sent when a session finishes successfully."
},
{
"type": "session.failed",
"description": "Sent when a session fails."
},
{
"type": "session.idle",
"description": "Sent when the agent finishes a run and waits for the next message."
},
{
"type": "session.status_updated",
"description": "Sent on every session status change, including running, completed, failed, timed out, interrupted, paused, idle, or awaiting tool results."
},
{
"type": "session.timed_out",
"description": "Sent when a session exceeds its time limit."
}
]
Was this page helpful?
⌘I