Setting up our webhook
We’ll use the Webhooks feature on the Agent to configure our automations. First, let’s create a webhook that posts to"https://example.com" every time a call ends.
Python
agent/update endpoint like before:
Python
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
"https://example.com" every time a call ends.
from vocode import AgentUpdateParams, EventType, HttpMethod, WebhookUpdateParams
new_webhook = WebhookUpdateParams(
subscriptions=[EventType.EVENT_PHONE_CALL_ENDED],
url="https://example.com",
method=HttpMethod.POST,
)
agent/update endpoint like before:
update_response = vocode_client.agents.update_agent(
id=agent_id,
request=AgentUpdateParams(
webhook=new_webhook.id
),
)
