Webhook Events
Available events
| Event | Description |
|---|---|
call.ended | Fired when an AI call finishes (completed, failed, or cancelled) |
More events coming soon
Future events will include appointment.created, appointment.cancelled, sms.received, contact.created, and more.
call.ended
Sent when an AI call finishes, regardless of outcome.
Payload
json
{
"id": "evt-delivery-uuid",
"event": "call.ended",
"timestamp": "2026-04-05T14:04:00Z",
"data": {
"callId": "clx-call-001",
"organizationId": "clx-org-001",
"agentId": "clx-agent-001",
"agentName": "Sales Agent",
"customerName": "John Doe",
"customerPhone": "+1234567890",
"fromNumber": "+0987654321",
"direction": "OUTBOUND",
"status": "completed",
"duration": 240,
"disconnectionReason": "agent_hangup",
"sentiment": "positive",
"summary": "Discussed enterprise pricing. Customer interested in annual plan.",
"transcript": "Agent: Hello John, this is...\nJohn: Hi, yes I was...",
"callSuccessful": true,
"tokenCost": 12.50,
"startedAt": "2026-04-05T14:00:00Z",
"endedAt": "2026-04-05T14:04:00Z",
"metadata": {
"campaign_id": "summer_2026"
}
}
}Fields
| Field | Type | Description |
|---|---|---|
callId | string | Unique call identifier |
organizationId | string | Your organization ID |
agentId | string | Agent that handled the call |
agentName | string | Display name of the agent |
customerName | string | null | Name of the person called |
customerPhone | string | Destination phone number |
fromNumber | string | Caller ID used |
direction | string | INBOUND or OUTBOUND |
status | string | Final call status |
duration | integer | Call duration in seconds |
disconnectionReason | string | null | Why the call ended |
sentiment | string | null | AI-detected sentiment |
summary | string | null | AI-generated call summary |
transcript | string | null | Full call transcript |
callSuccessful | boolean | null | Whether the call achieved its objective |
tokenCost | number | Cost in tokens/credits |
startedAt | string | null | ISO 8601 call start time |
endedAt | string | null | ISO 8601 call end time |
metadata | object | null | Custom metadata set at call creation |
Example handler (Node.js)
javascript
app.post('/webhook', (req, res) => {
const { event, data } = req.body
if (event === 'call.ended') {
console.log(`Call ${data.callId} ended`)
console.log(`Status: ${data.status}, Duration: ${data.duration}s`)
console.log(`Sentiment: ${data.sentiment}`)
// Save to your CRM, notify your team, etc.
if (data.callSuccessful) {
notifyTeam(`Successful call with ${data.customerName}`)
}
}
// Always respond 2xx
res.status(200).json({ received: true })
})
