Events
Everything that happens in your workspace is an event. The same events are delivered to webhooks, the realtime stream and per-call webhook_urls.
Envelope
json
{
"id": "evt_8f2c…",
"type": "call.ended",
"workspace_id": "ws_123",
"created_at": "2026-11-23T10:15:00.000Z",
"data": { "call_id": "call_abc", "status": "completed", "duration_sec": 74, "billable_sec": 74 }
}- At-least-once delivery. Retries can deliver the same event twice — de-duplicate on
id. - Ordering is best-effort: events for one call are emitted in order, but retries can reorder deliveries. Use
created_at, and treat terminal events (call.ended) as authoritative for status. client_stateyou set on a call is echoed indata.client_stateof every call event.- Unknown types: new event types are added over time; ignore types you don't handle.
In the SDKs, events are a typed union — switch on type and data narrows:
ts
import type { KolwireEvent } from "@kolwire/sdk";
function handle(event: KolwireEvent) {
switch (event.type) {
case "call.ended":
return console.log(event.data.status, event.data.duration_sec);
case "message.received":
return console.log(event.data.from, event.data.body);
}
}python
def handle(event):
if event.type == "call.ended":
print(event.data.status, event.data.duration_sec)
elif event.type == "message.received":
print(event.data.body)Catalog
CallRef = call_id, direction? (inbound/outbound), from?, to?, client_state?. MessageRef = message_id, channel (sms/mms/whatsapp), from, to, conversation_id?, contact_id?.
Calls
| Type | data |
|---|---|
call.initiated | CallRef |
call.ringing | CallRef |
call.answered | CallRef + answered_at |
call.bridged | CallRef + other_call_id?, target? |
call.dtmf | CallRef + digit |
call.gather.completed | CallRef + digits?, speech?, reason (completed/timeout/max_digits/terminator) |
call.speech | CallRef + text |
call.machine_detection | CallRef + result (human/machine/unknown), beep? |
call.playback.started | CallRef + playback_id? |
call.playback.ended | CallRef + playback_id? |
call.recording.ready | CallRef + recording_id, url?, duration_sec? |
call.transcript.partial | Segment: call_id, segment_id, speaker, channel?, text, is_final, start_ms, end_ms, confidence?, language? |
call.transcript.final | Segment (as above, is_final: true) |
call.transcript.ready | CallRef + transcript_id |
call.intelligence.ready | CallRef + summary?, sentiment?, action_items, extracted?, score? |
call.assist.suggestion | call_id, suggestion_id, kind (answer/objection/battlecard/missing_question/compliance/coaching/next_step), title, body, trigger_text?, priority (low/normal/high) |
call.agent.turn | CallRef + role (agent/user), text, latency_ms? |
call.agent.tool_call | CallRef + tool, arguments, result? |
call.agent.handoff | CallRef + target, summary? |
call.transferred | CallRef + target |
call.ended | CallRef + status (completed/busy/no_answer/failed/canceled/…), hangup_cause?, duration_sec?, billable_sec? |
call.queued | CallRef + queue_id, position? |
call.dispositioned | CallRef + code, team_agent_id?, notes?, fields? |
Contact center
| Type | data |
|---|---|
agent.status_changed | team_agent_id, status, previous_status?, call_id? |
queue.entry.updated | queue_id, entry_id, status, call_id?, team_agent_id? |
campaign.started | campaign_id |
campaign.completed | campaign_id, stats? (counts by outcome) |
Messaging
| Type | data |
|---|---|
message.received | MessageRef + body?, media |
message.sent | MessageRef |
message.delivered | MessageRef |
message.read | MessageRef (WhatsApp) |
message.failed | MessageRef + error_code?, error_message? |
conversation.opted_out | phone, channel, keyword? |
conversation.opted_in | phone, channel, keyword? |
Account
| Type | data |
|---|---|
number.ported | port_request_id, numbers |
billing.low_balance | org_id, balance_cents |
verification.sent | verification_id, to, channel, status, profile_id, metadata |
verification.approved | same as verification.sent |
verification.failed | same, plus reason (max_attempts_reached or a delivery error code) |
Subscribing
- Webhook endpoints (
vi.webhookEndpoints.create({ url, event_types: ["call.*", "message.received"] })) receive matching events for the whole workspace; also deliverable to GCP Pub/Sub or AWS SQS (kind). - Per-call
webhook_urloncalls.create(or the number'svoice_config) receives that call's events and can reply with commands. - Realtime stream for browsers and low-latency consumers — see realtime protocol.
- History:
vi.calls.events(callId)lists a call's event timeline.