curl --request POST \
--url https://api.example.com/api/v1/voice/upload \
--header 'Content-Type: application/json' \
--data '
{
"parties": "<string>",
"contract_type": "<string>"
}
'{
"transcript": "<string>",
"terms": {},
"processing_status": "<string>",
"confidence_score": 123
}Upload audio files directly for immediate processing and term extraction
curl --request POST \
--url https://api.example.com/api/v1/voice/upload \
--header 'Content-Type: application/json' \
--data '
{
"parties": "<string>",
"contract_type": "<string>"
}
'{
"transcript": "<string>",
"terms": {},
"processing_status": "<string>",
"confidence_score": 123
}.wav - WAV audio.mp3 - MP3 audio.m4a - M4A/AAC audio.ogg - OGG Vorbis audio'[{"phone":"+254712345678","role":"buyer"}]'agricultural_supply, service_agreement, loan_agreementtotal_amount: Transaction amountcurrency: Currency codedelivery_date: Delivery deadlinedelivery_location: Delivery addressquality_requirements: Product specificationspayment_terms: Payment conditionscompleted, failed, or partialcurl -X POST https://api.voicepact.com/api/v1/voice/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@/path/to/contract_recording.mp3" \
-F "contract_type=agricultural_supply" \
-F 'parties=[{"phone":"+254712345678","role":"buyer"},{"phone":"+254787654321","role":"seller"}]'
import requests
url = "https://api.voicepact.com/api/v1/voice/upload"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
files = {
"file": open("contract_recording.mp3", "rb")
}
data = {
"contract_type": "agricultural_supply",
"parties": '[{"phone":"+254712345678","role":"buyer"}]'
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
const formData = new FormData();
formData.append('file', audioFile); // File object from input
formData.append('contract_type', 'agricultural_supply');
formData.append('parties', JSON.stringify([
{phone: '+254712345678', role: 'buyer'}
]));
fetch('https://api.voicepact.com/api/v1/voice/upload', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
})
.then(response => response.json())
.then(data => console.log(data));
{
"transcript": "I agree to sell 50 kilograms of coffee beans at 800 shillings per kilogram. The buyer agrees to pay 40,000 shillings total. Delivery will be to Thika warehouse by March 15th. The coffee must be grade AA with moisture content below 11%.",
"terms": {
"total_amount": 40000,
"currency": "KES",
"quantity": "50 kg",
"unit_price": 800,
"product": "coffee beans",
"delivery_date": "2026-03-15",
"delivery_location": "Thika warehouse",
"quality_requirements": [
"Grade AA coffee",
"Moisture content below 11%"
],
"payment_terms": "Full payment of KES 40,000"
},
"processing_status": "completed",
"confidence_score": 0.91
}
{
"detail": "Unsupported audio format"
}
{
"detail": "File processing failed: Audio quality too low for transcription"
}
{
"detail": "File size exceeds 100 MB limit"
}
{
"detail": "File processing failed: Internal transcription service error"
}
processing_status before using termsconfidence_score is acceptable (> 0.7 recommended)