Skip to content

Direct TTS Broadcast

POST /api/broadcasts/direct-tts

Send a broadcast from plain text — the text is converted to speech (AI TTS) and played to each recipient. Processing is asynchronous: the API accepts the request, generates the audio in the background, then queues the calls.

Parameter Type Required Description
request_id string Yes Unique request identifier (16-64 chars) to prevent duplicate requests. Use UUID or random string.
sender string Yes Your active caller sender number (1-20 chars)
phone_numbers array Yes Array of Bangladeshi phone numbers (01XXXXXXXXX format, 1-999 numbers). No duplicates allowed.
texts array Yes Text strings (1-10, max 5000 chars each by default), converted to speech and played in order.
voice string No male or female (default: provider default voice)
language_code string No Language code, e.g. bn-BD (max 10 chars; default: account/provider default)
metadata object No Custom data to associate with the broadcast.
Terminal window
curl -X POST https://api.awajdigital.com/api/broadcasts/direct-tts \
-H "Authorization: Bearer your_api_token_here" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"request_id": "unique_direct_tts_001",
"sender": "8801234567890",
"phone_numbers": ["019XXXXXXXX", "018XXXXXXXX"],
"texts": ["আসসালামু আলাইকুম। আগামীকাল আমাদের অফিস বন্ধ থাকবে।"],
"voice": "female",
"language_code": "bn-BD",
"metadata": { "campaign_id": "tts_broadcast_2026" }
}'
{
"success": true,
"message": "TTS broadcast request accepted, processing started",
"data": {
"request_id": "unique_direct_tts_001"
}
}

The 202 response means the request was accepted, not that calls have started. Poll Get Direct TTS Broadcast Status with the same request_id until it is completed, then poll Get Broadcast Result for per-number call outcomes.

Status Description
400 Duplicate phone numbers in request
402 Insufficient account balance
403 Required permissions not enabled, or sender not found / not active
422 Invalid request parameters (request_id length, phone format, array size, text length)
429 Rate limited — max 1 request per second per account