Skip to content

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_state you set on a call is echoed in data.client_state of 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 ​

Typedata
call.initiatedCallRef
call.ringingCallRef
call.answeredCallRef + answered_at
call.bridgedCallRef + other_call_id?, target?
call.dtmfCallRef + digit
call.gather.completedCallRef + digits?, speech?, reason (completed/timeout/max_digits/terminator)
call.speechCallRef + text
call.machine_detectionCallRef + result (human/machine/unknown), beep?
call.playback.startedCallRef + playback_id?
call.playback.endedCallRef + playback_id?
call.recording.readyCallRef + recording_id, url?, duration_sec?
call.transcript.partialSegment: call_id, segment_id, speaker, channel?, text, is_final, start_ms, end_ms, confidence?, language?
call.transcript.finalSegment (as above, is_final: true)
call.transcript.readyCallRef + transcript_id
call.intelligence.readyCallRef + summary?, sentiment?, action_items, extracted?, score?
call.assist.suggestioncall_id, suggestion_id, kind (answer/objection/battlecard/missing_question/compliance/coaching/next_step), title, body, trigger_text?, priority (low/normal/high)
call.agent.turnCallRef + role (agent/user), text, latency_ms?
call.agent.tool_callCallRef + tool, arguments, result?
call.agent.handoffCallRef + target, summary?
call.transferredCallRef + target
call.endedCallRef + status (completed/busy/no_answer/failed/canceled/…), hangup_cause?, duration_sec?, billable_sec?
call.queuedCallRef + queue_id, position?
call.dispositionedCallRef + code, team_agent_id?, notes?, fields?

Contact center ​

Typedata
agent.status_changedteam_agent_id, status, previous_status?, call_id?
queue.entry.updatedqueue_id, entry_id, status, call_id?, team_agent_id?
campaign.startedcampaign_id
campaign.completedcampaign_id, stats? (counts by outcome)

Messaging ​

Typedata
message.receivedMessageRef + body?, media
message.sentMessageRef
message.deliveredMessageRef
message.readMessageRef (WhatsApp)
message.failedMessageRef + error_code?, error_message?
conversation.opted_outphone, channel, keyword?
conversation.opted_inphone, channel, keyword?

Account ​

Typedata
number.portedport_request_id, numbers
billing.low_balanceorg_id, balance_cents
verification.sentverification_id, to, channel, status, profile_id, metadata
verification.approvedsame as verification.sent
verification.failedsame, 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_url on calls.create (or the number's voice_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.