Skip to main content
This page covers the essential APIs for building AI voice agents: initiating calls, handling incoming calls, and streaming audio.

Calls API Essentials

Audio streaming requires an active call. Here are the key operations you’ll need.

Make an Outbound Call

Required parameters: from (your Plivo number), to (destination), answer_url (returns XML with <Stream> element)
Your answer_url should return XML to start audio streaming:

Handle Incoming Calls

Configure your Plivo number’s Answer URL in the console. Plivo POSTs call details (CallUUID, From, To, Direction) to your server, which returns XML to start streaming.

Hang Up a Call

Transfer a Call

Redirect an active call to fetch new XML mid-call:
For SDK examples and additional parameters, see the complete Calls API reference.

Audio Streams API

The Audio Streams API lets you receive raw audio from active calls over a WebSocket connection in near real-time. Use it for real-time transcription, voice AI, call analytics, or custom audio processing.

API Endpoint


The Audio Stream Object

Example Response


Start an Audio Stream

Initiate streaming for an active call.

Parameters

Audio Formats

When bidirectional is true, audio_track cannot be outbound or both.

Start a Stream with Noise Cancellation


Retrieve an Audio Stream

Get details of a specific audio stream.

List All Audio Streams

Get all audio streams for a call.

Response


Stop a Specific Audio Stream

Stop streaming for a specific stream.
Response: HTTP 204 No Content

Stop All Audio Streams

Stop all active streams on a call.

Bidirectional Streaming

When bidirectional=true, your WebSocket server can send audio back to the call.

Sending Audio to Call

Send a JSON message to the WebSocket:

Status Callback Events

Notifications sent to status_callback_url: