Skip to main content
POST
/
api
/
v1
/
media
Upload media file
const form = new FormData();
form.append('File', '<string>');
form.append('Description', '<string>');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://blackbox.dasha.ai/api/v1/media', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "fileName": "<string>",
  "originalFileName": "<string>",
  "fileSizeBytes": 123,
  "contentType": "<string>",
  "createdTime": "2023-11-07T05:31:56Z",
  "description": "<string>"
}

Supported Formats

Only audio files are accepted. Supported formats include:
  • MP3 (audio/mpeg)
  • WAV (audio/wav)
  • OGG (audio/ogg)
  • Other audio/* MIME types

File Requirements

  • File cannot be empty
  • Content-Type header must start with audio/
  • Maximum file size limits apply (contact support for details)

Use Cases

Uploaded media files can be used for:
  • Hold music during call transfers
  • Background sounds for ambient noise
  • Custom audio prompts

Body

multipart/form-data
File
file
required

Audio file to upload. Supported formats include MP3, WAV, FLAC, and other common audio formats. The file is stored and can be referenced by its ID in agent configurations for transfers and ambient noise features.

Description
string

Description of the media file's purpose or content. Useful for organizing and identifying files when configuring agents, especially when managing multiple media files for different transfer scenarios or ambient sounds.

Maximum string length: 1000

Response

Media file uploaded successfully

Media file information including metadata, storage details, and usage context. Contains all data needed to reference the file in agent configurations and track its properties and lifecycle.

id
string<uuid>
required

Unique identifier for this media file. Use this ID when configuring agents to reference the file for warm transfers, cold transfers, or ambient noise features.

fileName
string
required

Server-assigned filename used for internal storage. This may differ from the original filename and is generated to ensure uniqueness and avoid conflicts in the storage system.

Minimum string length: 1
originalFileName
string
required

Original filename as provided during upload. Preserved for display purposes and to help identify the file in the user interface.

Minimum string length: 1
fileSizeBytes
integer<int64>
required

File size in bytes. Useful for storage management and estimating bandwidth requirements when the file is played during calls.

contentType
string
required

MIME content type detected from the uploaded file. Common values include "audio/mpeg" for MP3 files, "audio/wav" for WAV files, and "audio/flac" for FLAC files. Used for proper content handling and playback.

Minimum string length: 1
createdTime
string<date-time>
required

Timestamp when the media file was originally uploaded to the system.

description
string | null

Description of the media file's purpose or content. Helps identify and organize files when managing multiple media files for different use cases. Null when no description has been provided.