Skip to main content
Two endpoints are available for accessing call recordings:
  1. Stream endpoint - Returns a JSON object with a presigned URL for browser-native streaming
  2. Download endpoint - Returns the binary audio file for download

Stream Recording

Get a presigned URL for streaming the call recording in a browser.

Endpoint

GET /api/calls/{call_sid}/recording/stream

Path Parameters

string
required
The unique identifier of the call (format: call_ prefix + alphanumeric).

Response

Returns a JSON object containing a presigned S3 URL that can be used directly with an HTML5 audio element.
boolean
Indicates if the request was successful.
object
Recording URL data.
string
required
Presigned S3 URL for accessing the recording. Expires after 1 hour.
number
required
URL expiration time in seconds (3600 = 1 hour).
string
required
Content type of the recording (e.g., audio/wav, audio/mpeg).
string
required
Suggested filename for the recording.
The presigned URL supports HTTP range requests, allowing the browser to stream the audio file without downloading the entire file first. Use this endpoint for playback in audio players.

Download Recording

Download the recording as a binary audio file.

Endpoint

GET /api/calls/{call_sid}/recording/download

Path Parameters

string
required
The unique identifier of the call (format: call_ prefix + alphanumeric).

Response

Returns the audio file as a binary stream with appropriate headers for download.
string
audio/wav
string
attachment; filename="recording_{to_number}.wav"
number
Size of the audio file in bytes.
This endpoint returns binary audio data, not JSON. The presigned URL used internally expires after 5 minutes. Use this endpoint when you want to save the recording to disk.

Comparison


Frontend Usage Examples

Streaming (for playback)

Download (for saving)