Skip to main content

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

HTTPS Required:
  • All webhook URLs must use HTTPS protocol
  • HTTP endpoints will be rejected
  • Self-signed certificates are not supported
  • Certificate must be valid and not expired
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:
Not recommended for production. Anyone who discovers your webhook URL can send requests to it.
Use for production environments:
Token Format Requirements:
  • 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
Generating Secure Tokens:

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

  1. Configure your webhook URL and authentication
  2. Save your agent configuration
  3. Make a test call to your agent
  4. Monitor your webhook endpoint for incoming events
  5. Verify you receive the call.ended event 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
Solutions:

Authentication Failures

Possible Causes:
  • Bearer token mismatch
  • Token format incorrect (missing “Bearer” prefix)
  • Token changed in dashboard but not in code
Solution:
  • 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