Skip to main content
GET /v1/calls/:callId/stream Upgrades an HTTP connection to a WebSocket for real-time bidirectional audio streaming. This endpoint is used with DYNAMIC_STREAM calls.
WebSocket streaming is currently in preview and not yet available in production. The endpoint returns 501 Not Implemented until it ships.

How it works

  1. Create a DYNAMIC_STREAM call via POST /v1/calls
  2. Connect to this WebSocket endpoint using the returned callId
  3. Send audio frames; receive transcripts and call events
Client → Server: PCM or MP3 audio frames
Server → Client: Real-time transcripts and call events

WebSocket upgrade

GET /v1/calls/call_xyz789/stream HTTP/1.1
Host: cawme.com
Authorization: Bearer <token>
Upgrade: websocket
Connection: Upgrade
Successful upgrade returns 101 Switching Protocols.

Message format

Sending audio (client → server)

Send raw PCM or MP3 binary frames over the WebSocket connection.

Receiving events (server → client)

{
  "type": "transcript",
  "text": "Hello, I'm calling about your recent inquiry.",
  "timestamp": "2026-03-01T10:01:20Z"
}
{
  "type": "call_event",
  "event": "answered",
  "timestamp": "2026-03-01T10:01:15Z"
}

Request

Headers

HeaderValue
AuthorizationBearer <token>
Upgradewebsocket

Path parameters

ParameterTypeDescription
callIdstringThe call ID for a DYNAMIC_STREAM call

Errors

CodeDescription
401Missing or invalid token
501Not yet implemented

Example (JavaScript)

const ws = new WebSocket(
  "wss://cawme.com/api/v1/calls/call_xyz789/stream",
  [],
  {
    headers: {
      Authorization: "Bearer <token>",
    },
  }
);

ws.onopen = () => {
  // Send PCM audio frames
  ws.send(audioBuffer);
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(data.type, data.text ?? data.event);
};