Skip to main content

Request Payloads

These are the JSON payloads your webhook endpoint will receive for different events.

Call Completed Event

Triggered when a call attempt finishes (completed, failed, or retry).
{
  "event_type": "call_completed",
  "call_id": "adb64369-bb56-461e-a38a-9cc704e3210f",
  "call_duration": 9.4,
  "call_type": "outbound",
  "status": "completed",
  "to_number": "+919875436897",
  "from_number": "+918035736726",
  "agent_id": "8e1ba144-884f-49be-97ad-137cebc56913",
  "workspace_id": "442a9db3-0fd4-47dc-b8cd-cc7eedfa272f",
  "custom_args_values": {
    "callee_name": "John",
    "order_value": "70000",
    "company_name": "Acme Corp"
  },
  "transcript": [
    {"bot": "Hello, how can I help you today?"},
    {"user": "I need information about my order"},
    {"bot": "I'd be happy to help you with that. Can you provide your order number?"},
    {"user": "Sure, it's ORDER-12345"}
  ],
  "retry_count": 0
}

Recording Completed Event

Triggered when call recording is processed and ready for download.
{
  "event_type": "recording_completed",
  "call_id": "adb64369-bb56-461e-a38a-9cc704e3210f",
  "recording_url": "https://recordings.ringg.ai/v1/recordings/8c92980b-f47c-4b8b-877f-6daa81ab1d9e.mp3",
  "recording_duration": 19.3
}

Platform Analysis Event

Triggered when Ringg AI’s built-in analysis completes.
{
  "event_type": "platform_analysis_completed",
  "call_id": "adb64369-bb56-461e-a38a-9cc704e3210f",
  "analysis_data": {
    "key_points": [
      "Customer inquired about order status",
      "Order number provided: ORDER-12345",
      "Customer satisfied with response"
    ],
    "summary": "Customer called to check order delivery status. Agent provided tracking information and estimated delivery date.",
    "classification": "Order Inquiry",
    "sentiment": "positive",
    "call_disconnect_reason": "customer_hangup",
    "action_items": [
      "Follow up on delivery confirmation",
      "Send tracking number via SMS"
    ]
  },
  "call_type": "outbound",
  "status": "completed",
  "agent_id": "8e1ba144-884f-49be-97ad-137cebc56913",
  "workspace_id": "442a9db3-0fd4-47dc-b8cd-cc7eedfa272f",
  "transcript": [
    {"bot": "Hello, how can I help you today?"},
    {"user": "I need information about my order"},
    {"bot": "I'd be happy to help you with that. Can you provide your order number?"},
    {"user": "Sure, it's ORDER-12345"}
  ]
}

Client Analysis Event

Triggered when your custom analysis completes based on your configured prompts.
{
  "event_type": "client_analysis_completed",
  "call_id": "adb64369-bb56-461e-a38a-9cc704e3210f",
  "analysis_data": {
    "lead_quality": "high",
    "intent_score": 8.5,
    "next_action": "follow_up",
    "purchase_probability": 0.75,
    "customer_segment": "premium",
    "satisfaction_score": 9
  },
  "call_type": "outbound",
  "status": "completed",
  "agent_id": "8e1ba144-884f-49be-97ad-137cebc56913",
  "workspace_id": "442a9db3-0fd4-47dc-b8cd-cc7eedfa272f"
}

Implementation Examples

Node.js/Express

const express = require('express');
const app = express();

app.use(express.json());

// Handle all webhook events
app.post('/webhooks/:eventType', (req, res) => {
  const eventData = req.body;
  const eventType = req.params.eventType;
  
  console.log(`Received ${eventData.event_type} for call ${eventData.call_id}`);
  
  // Process based on event type
  switch(eventData.event_type) {
    case 'call_completed':
      // Store transcript, update call status
      console.log(`Call duration: ${eventData.call_duration}s`);
      break;
      
    case 'recording_completed':
      // Download and store recording
      console.log(`Recording: ${eventData.recording_url}`);
      break;
      
    case 'platform_analysis_completed':
      // Process AI insights
      console.log(`Classification: ${eventData.analysis_data.classification}`);
      break;
      
    case 'client_analysis_completed':
      // Handle custom analysis
      console.log(`Lead quality: ${eventData.analysis_data.lead_quality}`);
      break;
  }
  
  // Always acknowledge receipt
  res.status(200).json({ received: true });
});

app.listen(3000);

Field Descriptions

Common Fields

FieldTypeDescription
event_typestringType of event: call_completed, recording_completed, platform_analysis_completed, client_analysis_completed
call_idstringUnique identifier for the call
agent_idstringID of the AI agent that handled the call
workspace_idstringID of your workspace

Call Completed Fields

FieldTypeDescription
call_durationnumberDuration of the call in seconds
call_typestringDirection: outbound or inbound
statusstringFinal call status: completed, failed, retry
to_numberstringPhone number that received the call
from_numberstringPhone number that made the call
transcriptarrayArray of conversation turns with bot and user messages
custom_args_valuesobjectCustom data you provided when initiating the call
retry_countnumberNumber of retry attempts (0 for first attempt)

Recording Fields

FieldTypeDescription
recording_urlstringURL of the call recording
recording_durationnumberDuration of the recording in seconds

Analysis Fields

FieldTypeDescription
analysis_dataobjectAnalysis results - structure varies by analysis type
key_pointsarrayMain points extracted from the conversation (platform analysis)
summarystringBrief summary of the call (platform analysis)
classificationstringCall category/type (platform analysis)
sentimentstringOverall sentiment: positive, negative, neutral (platform analysis)