Post-Call Webhook API
Receive real-time call data, recordings, and analysis via webhooks.
Overview
When a call is completed on our platform, we automatically send call data to your configured webhook URL via HTTP POST. This allows you to receive real-time notifications with detailed call information including recordings, transcripts, caller details, and call analysis.
Configuration
To receive post-call webhooks, configure your webhook URL in your agent settings:
{
"webhooks": {
"postCall": "https://your-domain.com/webhook/call-completed"
}
}Requirements
- URL must use
http://orhttps://protocol. - Your endpoint must respond within 10 seconds.
- Your endpoint should return a
2xxstatus code to indicate successful receipt.
Webhook Payload
When a call completes, we send the following JSON payload to your webhook URL:
Request Details:
- Method:
POST - Content-Type:
application/json - Timeout: 10 seconds
Payload Structure
{
"callId": "string",
"recordingUri": "string",
"transcriptUri": "string",
"callerDetails": {
"name": "string",
"phoneNumber": "string",
"email": "string",
"scheduledTime": "string",
"address": "string",
"pincode": "string",
"city": "string",
"state": "string",
"country": "string",
"age": "string",
"gender": "string",
"occupation": "string",
"company": "string",
"preferredContactMethod": "string",
"bestTimeToCall": "string",
"language": "string"
},
"callAnalysis": {
"summary": "string",
"mood": "string",
"score": "number",
"callOutcome": "string",
"classification": "string",
"interestsAndNeeds": "object",
"actionItems": "object",
"sentiment": "object"
}
}Field Descriptions
| Field | Type | Description |
|---|---|---|
callId | string | Unique identifier for the call. |
recordingUri | string | URL to the call recording file (audio). |
transcriptUri | string | URL to the call transcript file (JSON). |
callerDetails | object | Extracted information about the caller. |
callAnalysis | object | AI-generated analysis of the call. |
Call Analysis Fields
| Field | Type | Description |
|---|---|---|
summary | string | AI-generated summary of the call. |
mood | string | Detected mood/emotion of the caller. |
score | number | Call quality/satisfaction score (0-100). |
callOutcome | string | Result of the call (e.g., "Appointment Scheduled"). |
classification | string | Call category/type classification. |
interestsAndNeeds | object | Extracted interests and requirements. |
actionItems | object | Follow-up actions identified from the call. |
sentiment | object | Detailed sentiment analysis. |
Example Payload
{
"callId": "693bff62619c51fac21acf50",
"recordingUri": "https://storage.example.com/recordings/693bff62619c51fac21acf50/call_recording.ogg",
"transcriptUri": "https://storage.example.com/transcripts/transcript_693bff62619c51fac21acf50.json",
"callerDetails": {
"name": "John Smith",
"phoneNumber": "+1-555-123-4567",
"email": "john.smith@example.com",
"scheduledTime": "2025-01-20T10:00:00Z",
"address": "123 Main Street",
"city": "New York",
"state": "NY",
"country": "USA",
"language": "English"
},
"callAnalysis": {
"summary": "Customer called to schedule a product demo...",
"mood": "Positive",
"score": 85,
"callOutcome": "Demo Scheduled",
"classification": "Sales Inquiry"
}
}Handling the Webhook
Recommended Implementation
- Acknowledge Quickly: Return a 200 OK response immediately upon receiving the webhook. Process the data asynchronously if needed.
- Idempotency: Use the
callIdto ensure you don't process the same call twice. - Error Handling: If your endpoint fails, the webhook will not be retried. Implement your own polling mechanism if you need guaranteed delivery.
Example Handler (Node.js/Express)
app.post('/webhook/call-completed', (req, res) => {
// Acknowledge receipt immediately
res.status(200).json({ received: true });
// Process asynchronously
const { callId, recordingUri, transcriptUri, callerDetails, callAnalysis } = req.body;
// Your processing logic here
processCallData(callId, {
recordingUri,
transcriptUri,
callerDetails,
callAnalysis
});
});Testing
You can test your webhook endpoint using curl:
curl -X POST https://your-domain.com/webhook/call-completed \
-H "Content-Type: application/json" \
-d '{
"callId": "test-call-123",
"recordingUri": "https://example.com/recording.ogg",
"callerDetails": {
"name": "Test User",
"phoneNumber": "+1-555-000-0000"
}
}'