Overview
Webhooks allow you to receive real-time notifications about call lifecycle events. Instead of polling the API, Telepath pushes events to your application.Setting Up Webhooks
Prerequisites
- HTTPS endpoint that accepts POST requests
- Ability to verify webhook signatures
- Basic logging for debugging
Configure Webhook Endpoint
- Go to Telepath Dashboard
- Navigate to Settings → Webhooks
- Enter your HTTPS webhook URL
- Select events to receive
- Save
Webhook URL Requirements
- Must be publicly accessible
- Must use HTTPS (not HTTP)
- Must accept POST requests
- Should respond with 2xx status code
- Should process within 30 seconds
- May receive up to 100 concurrent requests
Webhook Events
Call Started
Sent when a call connects through Telepath.call_id: Unique call identifiertimestamp: ISO 8601 timestampfrom: Caller’s phone numberto: Destination/your phone numberconnection_id: Which connection handled the callcarrier: Source carrier (if available)
Call Ended
Sent when a call disconnects.call_id: Unique call identifiertimestamp: When call endedduration_seconds: Total call lengthreason: How call ended (see below)metrics: Performance data
normal_disconnect: User hung upno_answer: Call went to voicemail/timeoutconnection_failed: Could not connect to AI agentnetwork_error: Network connectivity issueai_provider_error: AI provider returned errorcarrier_error: Carrier-side issueunknown: Unknown reason
AI Agent Connected
Sent when AI agent successfully connects.agent_type: Which provider (openai, elevenlabs, custom)agent_id: Specific agent identifier
AI Agent Disconnected
Sent when connection to AI agent drops.reason: Why disconnect occurrederror_message: Detailed error description
Error Occurred
Sent when an error happens during the call.error_code: Machine-readable error codeerror_message: Human-readable descriptionseverity: critical, warning, info
Processing Webhooks
Handling the Request
Verify Webhook Signature
Each webhook includes a signature header you should verify. Header:X-Telepath-Signature
Format: sha256=<hash>
Best Practices
Always Respond:Retry Logic
If your endpoint returns a non-2xx status or times out:- Retry 1: After 5 seconds
- Retry 2: After 30 seconds
- Retry 3: After 5 minutes
- Retry 4: After 30 minutes
- Retry 5: After 2 hours
Testing Webhooks
Test from Dashboard
- Go to Settings → Webhooks
- Click Test next to your webhook URL
- Select an event type
- Click Send Test Event
- Check your logs for receipt
Using Webhook Debugging Tools
Use services like Webhook.cool or RequestBin to inspect webhook payloads:- Create a temporary webhook URL
- Configure it in Telepath
- Make a test call
- View the request details
Local Testing with ngrok
For local development:Common Use Cases
Logging to Database
Triggering Actions
Real-time Dashboards
Integration with External Systems
Monitoring Webhooks
Check Webhook Status
- Go to Settings → Webhooks
- View delivery status:
- ✅ All recent events delivered
- ⚠️ Some events failed
- ❌ Endpoint unreachable
Review Failed Webhooks
- Click View Logs
- Filter by status
- See error messages
- Retry failed deliveries
Webhook Metrics
Available via API:- Total webhooks sent
- Delivery success rate
- Average delivery time
- Failures by error type
Troubleshooting
Webhooks Not Received
Check:- Endpoint is publicly accessible
- Using HTTPS, not HTTP
- Firewall allows inbound POST
- Endpoint accepts on correct path
- Send test webhook from dashboard
- Check logs for any errors
- Verify signature validation
Duplicate Events
Solution:- Implement idempotency using call_id
- Store received event IDs
- Skip if already processed
Slow Processing
Solution:- Move processing to background queue
- Return 200 immediately
- Process async to prevent timeouts
High Latency
Check:- Endpoint response time
- Database query performance
- External API calls
- Network conditions

