attach_agent_webhook
Attach an existing webhook to an agent for selected call events, replacing current subscriptions. Specify event types: pre-conversation, post-conversation, or analytics-completed.
Instructions
Attach an EXISTING webhook to an agent for the given events. This is the right tool for 'send this agent's call-start/call-end/analytics to an already-created webhook' — find the webhook with get_webhooks first, then pass its id here. WARNING: this REPLACES the agent's current subscriptions — the backend deletes all of the agent's existing webhook subscriptions and recreates them for this webhook only, so an agent points at one webhook at a time. To only remove subscriptions, use detach_agent_webhooks. Never guess or default the event types. If the user hasn't said which of call-start (pre-conversation), call-end (post-conversation), or analytics (analytics-completed) they want, ask them before calling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | The agent to attach the webhook to. | |
| webhook_id | Yes | An existing webhook's id (from get_webhooks). | |
| event_types | Yes | The events to deliver to this webhook for this agent. Never guess or default the event types. If the user hasn't said which of call-start (pre-conversation), call-end (post-conversation), or analytics (analytics-completed) they want, ask them before calling. |