Skip to main content
Each webhook event sends a JSON payload with relevant data. This page documents the structure of each event type.

Common Fields

All webhooks include these base fields:
{
  "event": "call.start | call.end | analytics.completed",
  "timestamp": "2024-07-15T14:30:00Z",
  "agent_id": "agent_abc123",
  "call_id": "call_xyz789"
}
FieldTypeDescription
eventstringEvent type identifier
timestampISO 8601When the event occurred
agent_idstringAgent that handled the call
call_idstringUnique call identifier

Call Start Event

Event: call.start Sent when a call connects, before conversation begins.
{
  "event": "call.start",
  "timestamp": "2024-07-15T14:30:00Z",
  "agent_id": "agent_abc123",
  "call_id": "call_xyz789",
  "call_direction": "inbound",
  "caller_phone": "+15551234567",
  "agent_phone": "+15559876543"
}
NEEDS PLATFORM INFO: Complete start event payload schema

Fields

FieldTypeDescription
call_directionstring”inbound” or “outbound”
caller_phonestringCaller’s phone number
agent_phonestringPhone number called/calling from

Call End Event

Event: call.end Sent when a call concludes.
{
  "event": "call.end",
  "timestamp": "2024-07-15T14:35:00Z",
  "agent_id": "agent_abc123",
  "call_id": "call_xyz789",
  "duration_seconds": 300,
  "disposition": "successful",
  "transcript": [
    {"role": "agent", "content": "Hello! How can I help?", "timestamp": "..."},
    {"role": "user", "content": "I have a question...", "timestamp": "..."}
  ],
  "variables": {
    "customer_name": "Jane Smith",
    "issue_type": "billing"
  }
}
NEEDS PLATFORM INFO: Complete end event payload schema

Fields

FieldTypeDescription
duration_secondsnumberCall length in seconds
dispositionstringOutcome category
transcriptarrayFull conversation
variablesobjectVariables collected/set

Analytics Completed Event

Event: analytics.completed Sent when post-call analysis finishes.
{
  "event": "analytics.completed",
  "timestamp": "2024-07-15T14:36:00Z",
  "agent_id": "agent_abc123",
  "call_id": "call_xyz789",
  "metrics": {
    "satisfaction_score": 4,
    "issue_resolved": true,
    "follow_up_needed": false,
    "product_discussed": "Widget Pro"
  }
}
NEEDS PLATFORM INFO: Complete analytics event payload schema

Fields

FieldTypeDescription
metricsobjectPost-call metrics you configured
Metric fields depend on what you set up in Post-Call Metrics.

Handling Payloads

Parse JSON

All payloads are JSON:
const payload = JSON.parse(req.body);
const eventType = payload.event;

Route by Event Type

Handle different events appropriately:
switch (payload.event) {
  case 'call.start':
    handleCallStart(payload);
    break;
  case 'call.end':
    handleCallEnd(payload);
    break;
  case 'analytics.completed':
    handleAnalytics(payload);
    break;
}

What’s Next