Webhook Conditions
Webhooks can be triggered at different points in the call lifecycle:| Condition | When it Triggers | Use Cases |
|---|---|---|
before_call | Before the agent answers | Pre-fetch caller info, check CRM records, inject context |
during_call | While the call is active | Create support tickets, real-time lookups, live integrations |
after_call | After the call ends | Log to CRM, send summaries, create follow-up tasks |
Limits: You can configure one
before_call webhook, up to two during_call webhooks, and one after_call webhook per agent.Adding a Webhook via Dashboard
Webhook Configuration
Each webhook requires the following configuration:Required Fields
| Field | Description |
|---|---|
| Name | Unique identifier for the webhook (e.g., Create_Zendesk_Ticket) |
| Friendly Name | Human-readable display name |
| Description | What this webhook does - helps the AI understand when to use it |
| Condition | When to trigger: before_call, during_call, or after_call |
| HTTP Method | GET, POST, PUT, PATCH, or DELETE |
| URL | The endpoint to send the request to |
Optional Fields
| Field | Description |
|---|---|
| Headers | HTTP headers for authentication (e.g., API keys, Bearer tokens) |
| Parameters | Data to send in the request body - AI extracts values from the conversation |
How Parameters Work
Parameters are the key to making webhooks intelligent. When you define parameters:- You specify the key name - What the external API expects (e.g.,
email,subject,priority) - You provide a default/example value - Used as a fallback or guide for the AI
- The AI extracts actual values - During the call, the AI analyzes the conversation and fills in real values
If you leave a parameter value empty, the AI will generate an appropriate value based on the conversation context.
Example Parameter Configuration
customer_nameandissue_summarywill be extracted from the conversationemaildefaults to[email protected]if the caller doesn’t provide oneprioritydefaults tonormalunless the AI determines otherwise
Real-World Examples
Zendesk Ticket Creation
Create a support ticket in Zendesk during or after a call:Zendesk Authentication
Zendesk Authentication
For Zendesk, use Basic authentication with your email and API token:In JavaScript:
Freshdesk Ticket Creation
CRM Integration (Before Call)
Fetch caller information before the agent answers:Post-Call Logging
Log call details to your system after the call ends:API Configuration
You can also configure webhooks via the API when creating or updating an agent. Webhooks are stored in theextensions.tools array:
Best Practices
Write Clear Descriptions
Write Clear Descriptions
The description helps the AI understand when to trigger the webhook. Be specific:Good: “Creates a support ticket when the customer reports a problem or needs help with their order”Bad: “Creates a ticket”
Use Meaningful Parameter Names
Use Meaningful Parameter Names
Use descriptive key names that match what your external API expects. The AI uses these names to understand what data to extract.
Provide Default Values
Provide Default Values
For optional parameters, provide sensible defaults. For required parameters where you want AI extraction, leave the value empty.
Secure Your Credentials
Secure Your Credentials
Never expose API keys in client-side code. Use environment variables or secure credential storage when possible.
Test Your Webhooks
Test Your Webhooks
Test your webhook endpoints independently before configuring them in your agent. Use tools like Postman or curl to verify they work correctly.
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Webhook not triggering | Wrong condition | Verify the condition matches when you want it to fire |
| Authentication errors | Invalid credentials | Check your API key/token and header format |
| Missing data in request | Parameters not configured | Ensure all required parameters are defined |
| Timeout errors | Slow external API | Consider using after_call for slow endpoints |
