Webhooks
Update a webhook
Update a webhook’s URL, events, description, or disabled state.
PATCH
/
api
/
v2
/
webhooks
/
{webhook_id}
from hai_agents import Client
client = Client()
webhook = client.webhooks.update_webhook(
webhook_id=webhook_id,
disabled=True,
)
print(webhook.disabled)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const webhook = await client.webhooks.updateWebhook({
webhookId,
disabled: true,
});
console.log(webhook.disabled);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/webhooks/$WEBHOOK_ID \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"disabled": true}'
Behavior
Only the fields you send change. To change the signingsecret, use Rotate secret.
Path parameters
string
required
The webhook’s
id (UUID).Request body
string
New target URL, up to 2048 characters. Must be
https:// and publicly reachable. It is verified with a HEAD request before the change is saved, and the old URL is kept if verification fails.string[]
Replacement list of event types, or
["*"] for the session.status_updated firehose.string
New label, up to 255 characters.
boolean
Set
true to pause deliveries without deleting the webhook. Setting false re-enables a webhook that was disabled automatically after repeated delivery failures.Response
200 with the updated webhook object.
from hai_agents import Client
client = Client()
webhook = client.webhooks.update_webhook(
webhook_id=webhook_id,
disabled=True,
)
print(webhook.disabled)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const webhook = await client.webhooks.updateWebhook({
webhookId,
disabled: true,
});
console.log(webhook.disabled);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/webhooks/$WEBHOOK_ID \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"disabled": true}'
Errors
| Status | Cause |
|---|---|
400 | The new URL does not resolve to a public address or could not be reached. |
404 | Not found, or not in your organization. |
422 | Body failed validation: non-https URL, empty or unknown enabled_events, or null for url, enabled_events, or disabled. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
webhook = client.webhooks.update_webhook(
webhook_id=webhook_id,
disabled=True,
)
print(webhook.disabled)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const webhook = await client.webhooks.updateWebhook({
webhookId,
disabled: true,
});
console.log(webhook.disabled);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/webhooks/$WEBHOOK_ID \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"disabled": true}'