Skip to content

Stream call events (SSE)

GET /calls/{call_id}/events

https://api.voygr.tech/calls/{call_id}/events

Open in playground

Overview

Stream live call events as text/event-stream, parsing each SSE event as it arrives rather than waiting for the response to finish. Start with after_event_id=0; on reconnect, pass the last received id as after_event_id. Last-Event-ID is not supported. Heartbeat events keep idle connections alive: ignore them and SSE comments, keeping the last event ID when no id is present. Reconnect after a disconnect while the call is active, and check GET /calls/{call_id} for its terminal status.

Events: status_change. ask_user: a mid-call question with request_id and message; it arrives whatever the call's ask_user_mode, so answer it promptly via POST /calls/{call_id}/answer. answered: your answer was accepted. outcome: terminal, with result, ended_by, line_kind, result_reason, the deprecated outcome_type, billable, charge_cents, charge_reason and summary. Its billable is the outcome family, not the bill, so read charge_cents. recording_ready. recording_revoked: the callee refused recording, so no recording or transcript will be served. transcript_ready: the post-call check of the recording has finished and its marks are on transcript_full. Its data is {at, turns_count, duration_ms, corrections, unheard}: corrections counts the rows where the recording differs, unheard the heard: false rows it added. It fires only when the check is saved, usually after the stream has closed, so poll GET /calls/{call_id} for transcript_status instead of waiting for it.

Authentication

  • API key in header X-API-Key: Your customer API key (pk_live_...), sent on every request. Self-serve at https://api.voygr.tech/checkout.

Parameters

NameLocationRequiredTypeDescription and constraints
call_idpathrequiredstring
after_event_idqueryoptionalinteger (0 to 9223372036854775807) | nullReturn only events with event_id greater than this cursor. Start at 0; advance to the last id: you received.

Responses

200

SSE stream: the call's event history from the cursor, then live events with heartbeats. It closes about 5 seconds after the outcome event, or after 30 minutes.

text/event-stream

Schema: string

statuschange

"id: 2077\nevent: status_change\ndata: {\"event_id\": 2077, \"call_id\": \"c_abc123\", \"event_type\": \"status_change\", \"data\": {\"status\": \"dialing\"}}\n\n"

401

Missing or invalid X-API-Key.

application/json

X-API-Key header absent

{
  "detail": {
    "error": "API key required"
  }
}

X-API-Key doesn't resolve to an active key

{
  "detail": {
    "error": "invalid API key"
  }
}

404

Call not found, or isn't yours.

application/json

notfound

{
  "detail": "Call not found"
}