Skip to main content

Single Audio Upload

Upload one audio file at a time with accompanying metadata for transcription and analysis.
For uploading multiple files at once, see Batch Upload.

Request

POST /api/v1/audio/upload
Authorization: Bearer YOUR_TOKEN
Content-Type: multipart/form-data

Form Data

KeyTypeDescription
audio_fileFileThe audio recording file
metadataTextJSON string with call metadata

Metadata Structure

{
  "audio_file_name": "call_001.wav",
  "client_phone_number": "+77012345678",
  "operator_name": "John Smith",
  "start_time": "2026-01-13T10:30:00",
  "segment_type": "sales",
  "right_channel": "operator",
  "left_channel": "client",
  "partner_call_id": "CALL-001",
  "direction": "inbound",
  "operator_group_name": "Sales Team",
  "disconnect_reason": "completed"
}

Required Fields

FieldTypeDescriptionExample
audio_file_namestringFile name (must match the uploaded file)call_001.wav
client_phone_numberstringCustomer phone number+77012345678
operator_namestringOperator nameJohn Smith
start_timedatetimeCall start time (ISO 8601)2026-01-13T10:30:00
segment_typestringSegment type (must exist in your organization)sales
right_channelstringRight audio channel role: operator or clientoperator
left_channelstringLeft audio channel role: operator or clientclient

Optional Fields

FieldTypeDescription
partner_call_idstringExternal call ID from your system
directionstringinbound or outbound
operator_group_namestringOperator group name
disconnect_reasonstringReason the call ended

Supported Audio Formats

.wav, .mp3, .flac, .ogg, .aiff, .au Maximum file size: 50 MB
Audio files must be stereo. The file name must exactly match the audio_file_name value in metadata.

Response

Success 200

{
  "status": "ok",
  "audio_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "message": "Audio and metadata uploaded successfully"
}

Error 400

{
  "status": "error",
  "code": "INVALID_FILE_FORMAT",
  "message": "Unsupported audio format. Allowed: .aiff, .au, .flac, .mp3, .ogg, .wav",
  "details": null
}

Error Codes

CodeDescription
MISSING_FILEMissing audio_file or metadata
INVALID_FILE_FORMATUnsupported audio format
FILE_TOO_LARGEFile exceeds 50 MB
INVALID_PHONE_NUMBERInvalid phone number format
AUDIO_FILENAME_MISMATCHFile name doesn’t match audio_file_name in metadata
VALIDATION_ERRORField validation error

Channel Identification

To determine which speaker is on which channel, you can use an audio analysis tool like AudioMass — upload a sample recording and check which channel carries operator vs. client speech.