Single Audio Upload
Upload one audio file at a time with accompanying metadata for transcription and analysis.
Request
POST /api/v1/audio/upload
Authorization: Bearer YOUR_TOKEN
Content-Type: multipart/form-data
| Key | Type | Description |
|---|
audio_file | File | The audio recording file |
metadata | Text | JSON string with call metadata |
{
"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
| Field | Type | Description | Example |
|---|
audio_file_name | string | File name (must match the uploaded file) | call_001.wav |
client_phone_number | string | Customer phone number | +77012345678 |
operator_name | string | Operator name | John Smith |
start_time | datetime | Call start time (ISO 8601) | 2026-01-13T10:30:00 |
segment_type | string | Segment type (must exist in your organization) | sales |
right_channel | string | Right audio channel role: operator or client | operator |
left_channel | string | Left audio channel role: operator or client | client |
Optional Fields
| Field | Type | Description |
|---|
partner_call_id | string | External call ID from your system |
direction | string | inbound or outbound |
operator_group_name | string | Operator group name |
disconnect_reason | string | Reason the call ended |
.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
| Code | Description |
|---|
MISSING_FILE | Missing audio_file or metadata |
INVALID_FILE_FORMAT | Unsupported audio format |
FILE_TOO_LARGE | File exceeds 50 MB |
INVALID_PHONE_NUMBER | Invalid phone number format |
AUDIO_FILENAME_MISMATCH | File name doesn’t match audio_file_name in metadata |
VALIDATION_ERROR | Field 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.