Webhooks
List event types
List the event types a webhook can subscribe to.
GET
/
api
/
v2
/
webhooks
/
events
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);
}
curl https://agp.eu.hcompany.ai/api/v2/webhooks/events \
-H "Authorization: Bearer $HAI_API_KEY"
[
{
"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 ends `completed`."
},
{
"type": "session.failed",
"description": "Sent when a session fails."
},
{
"type": "session.idle",
"description": "Sent when the agent finishes a turn 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 queued session never starts within 24 hours."
}
]
Response
200 with an array of event type definitions.
string
The event type identifier, for example
session.completed.string
When the event is sent.
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);
}
curl https://agp.eu.hcompany.ai/api/v2/webhooks/events \
-H "Authorization: Bearer $HAI_API_KEY"
[
{
"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 ends `completed`."
},
{
"type": "session.failed",
"description": "Sent when a session fails."
},
{
"type": "session.idle",
"description": "Sent when the agent finishes a turn 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 queued session never starts within 24 hours."
}
]
Was this page helpful?
⌘I
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);
}
curl https://agp.eu.hcompany.ai/api/v2/webhooks/events \
-H "Authorization: Bearer $HAI_API_KEY"
[
{
"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 ends `completed`."
},
{
"type": "session.failed",
"description": "Sent when a session fails."
},
{
"type": "session.idle",
"description": "Sent when the agent finishes a turn 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 queued session never starts within 24 hours."
}
]