Configuring Webhooks
Learn how to configure webhook endpoints for your AI agents to receive real-time call events and conversation data.What are Webhooks?
Webhooks allow your applications to receive real-time notifications about call events, transcriptions, and conversation outcomes. When a voice call completes or specific events occur, Hamsa sends HTTP POST requests to your configured endpoint with relevant data.Real-time Events
Instant notifications as calls progress, from start to completion
Call Data
Full transcripts, recordings, and extracted information
Custom Parameters
Pass ANY custom data that gets echoed back for identification
Secure Delivery
HTTPS-only with Bearer token authentication support
Prerequisites
Before setting up webhooks, ensure you have:1
A publicly accessible server
Your webhook endpoint must be reachable from the internet. Use ngrok for local development.
2
HTTPS enabled
All webhook URLs must use HTTPS. HTTP endpoints will be rejected.
3
A web framework
Express.js, Flask, FastAPI, or any framework that can handle POST requests.
4
Basic authentication setup
Prepare to implement Bearer token authentication (recommended for production).
Webhook URL Requirements
Valid Examples:Local Development Setup
For local development, use ngrok to expose your localhost:Authentication Options
Option 1: No Authentication (Development Only)
Use for development or testing:Option 2: Bearer Token Authentication (Recommended)
Use for production environments:- Must include the word “Bearer” followed by your token
- Example:
Bearer sk_live_abc123xyz789 - Token should be long and randomly generated
- Never commit tokens to source control
Adding Webhook to Your Agent
1
Navigate to Agent Configuration
Go to your agent’s configuration page in the Hamsa dashboard
2
Find Call Webhook Section
Scroll to the Call Webhook section and click to expand
3
Enter Webhook URL
Input your publicly accessible HTTPS webhook URL
4
Configure Authentication
Choose authentication method and enter your Bearer token if applicable
5
Save Configuration
Save your agent configuration to activate the webhook
Webhooks are configured per agent. Each agent can have its own webhook URL and authentication settings.
Event Types
Your webhook receives various events throughout a call’s lifecycle:Testing Your Webhook
Test with cURL
Test from Dashboard
- Configure your webhook URL and authentication
- Save your agent configuration
- Make a test call to your agent
- Monitor your webhook endpoint for incoming events
- Verify you receive the
call.endedevent with full data
Common Issues
Webhook Not Receiving Data
Possible Causes:- Webhook URL is not publicly accessible
- Webhook URL not configured in Hamsa dashboard
- Firewall/security rules blocking POST requests
- Server not running or crashed
- HTTPS certificate invalid
Authentication Failures
Possible Causes:- Bearer token mismatch
- Token format incorrect (missing “Bearer” prefix)
- Token changed in dashboard but not in code
- Verify token format:
Bearer sk_live_abc123xyz789 - Ensure token matches exactly between dashboard and your code
- Check for extra spaces or formatting issues
Next Steps
Now that you’ve configured webhooks in the dashboard, learn how to implement webhook handlers:Build Webhook Handlers
Complete guide to implementing webhook endpoints and processing events
Webhooks Feature Overview
Learn about webhook concepts and patterns
Outcomes Configuration
Configure what data your agent extracts
Testing Webhooks
Test your webhook integration