Skip to main content
POST
/
recordings
/
{id}
/
download-url
curl -X POST https://api.bota.dev/v1/recordings/rec_abc123/download-url \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "media_id": "med_001"
  }'
{
  "download_url": "https://bota-uploads.s3.amazonaws.com/proj_xxx/rec_abc123/med_001/audio.opus?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
  "media_id": "med_001",
  "content_type": "audio/opus",
  "file_size_bytes": 1048576,
  "expires_at": "2025-01-15T12:00:00Z"
}
Generate a pre-signed S3 URL for downloading a media file associated with a recording. Pass the media_id to specify which file to download.

Authentication

Requires an API key with recordings:read scope.
curl -X POST https://api.bota.dev/v1/recordings/rec_abc123/download-url \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "media_id": "med_001"
  }'

Path Parameters

id
string
required
The recording’s unique identifier (e.g., rec_abc123).

Request Body

media_id
string
required
The media item to download (e.g., med_001). Get available media IDs from the recording’s media array.

Response

Returns a pre-signed S3 download URL along with file metadata and an expiration timestamp.
{
  "download_url": "https://bota-uploads.s3.amazonaws.com/proj_xxx/rec_abc123/med_001/audio.opus?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
  "media_id": "med_001",
  "content_type": "audio/opus",
  "file_size_bytes": 1048576,
  "expires_at": "2025-01-15T12:00:00Z"
}

Response Fields

FieldTypeDescription
download_urlstringPre-signed S3 URL for downloading the file
media_idstringThe requested media identifier
content_typestringMIME type of the file (e.g., audio/opus, image/jpeg)
file_size_bytesintegerFile size in bytes
expires_atstringISO 8601 timestamp when the download URL expires (1 hour from creation)

Using the Download URL

The pre-signed URL can be used directly:
cURL
# Download the file
curl -o recording.opus "https://bota-uploads.s3.amazonaws.com/..."
Browser
// Play audio in browser
const audio = new Audio(download_url);
audio.play();

// Or display image
const img = document.createElement('img');
img.src = download_url;
Python
import requests

# Download the file
response = requests.get(download_url)
with open('recording.opus', 'wb') as f:
    f.write(response.content)
The download URL expires after 1 hour. If expired, request a new URL. The media must be in uploaded status.