cllr Logocllr

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:// or https:// protocol.
  • Your endpoint must respond within 10 seconds.
  • Your endpoint should return a 2xx status 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

FieldTypeDescription
callIdstringUnique identifier for the call.
recordingUristringURL to the call recording file (audio).
transcriptUristringURL to the call transcript file (JSON).
callerDetailsobjectExtracted information about the caller.
callAnalysisobjectAI-generated analysis of the call.

Call Analysis Fields

FieldTypeDescription
summarystringAI-generated summary of the call.
moodstringDetected mood/emotion of the caller.
scorenumberCall quality/satisfaction score (0-100).
callOutcomestringResult of the call (e.g., "Appointment Scheduled").
classificationstringCall category/type classification.
interestsAndNeedsobjectExtracted interests and requirements.
actionItemsobjectFollow-up actions identified from the call.
sentimentobjectDetailed 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

  1. Acknowledge Quickly: Return a 200 OK response immediately upon receiving the webhook. Process the data asynchronously if needed.
  2. Idempotency: Use the callId to ensure you don't process the same call twice.
  3. 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"
  }
}'