Skip to content

Dynamic Broadcast

POST /api/broadcasts/dynamic

Send a personalized broadcast using a dynamic voice — an approved voice with variable parts (name, amount, etc.) filled in per recipient. Processing is asynchronous: the API accepts the request, then creates one broadcast per recipient in the background.

Parameter Type Required Description
request_id string Yes Unique request identifier (16-64 chars) to prevent duplicate requests. Use UUID or random string.
voice string Yes Name of an approved voice owned by your account (1-255 chars). The voice must have dynamic parts with configured dynamic keys.
sender string Yes Your active caller sender number (1-20 chars)
recipients array Yes 1-10 recipient objects (see below). No duplicate phone numbers.
Field Type Required Description
phone_number string Yes Bangladeshi phone number, 01XXXXXXXXX format.
data object Yes Key/value pairs (string values, max 5000 chars each by default). Every dynamic key required by the voice must be present and non-empty.

Dynamic voices support parts in these modes: tts (text spoken by AI TTS), number, character, digit, and audio_url (a CDN audio URL played in place). audio_url values are downloaded and validated as G.711-compatible WAV (8000 Hz, mono, pcm_s16le) during processing; an invalid file marks the request as failed.

Terminal window
curl -X POST https://api.awajdigital.com/api/broadcasts/dynamic \
-H "Authorization: Bearer your_api_token_here" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"request_id": "unique_dynamic_broadcast_001",
"voice": "due_reminder_dynamic",
"sender": "8801234567890",
"recipients": [
{
"phone_number": "019XXXXXXXX",
"data": { "customer_name": "রহিম উদ্দিন", "due_amount": "1250" }
},
{
"phone_number": "018XXXXXXXX",
"data": { "customer_name": "করিম শেখ", "due_amount": "3400" }
}
]
}'
{
"success": true,
"message": "Request accepted",
"data": {
"request_id": "unique_dynamic_broadcast_001"
}
}

The 202 response means the request was accepted, not that calls have started. Processing creates one broadcast per recipient, all sharing the same request_id. There is no dedicated status endpoint — poll List Broadcasts with ?request_id=<request_id> until the broadcasts appear, then use Get Broadcast Result for each ID. If processing fails, the List Broadcasts response includes the failure in data.error.

Status Description
400 Duplicate recipient phone numbers, voice has no dynamic parts / configured keys, or missing dynamic data for a recipient
402 Insufficient account balance
403 Voice not found / not approved, sender not found / not active, or missing AI TTS permission for tts dynamic parts
422 Invalid request parameters (request_id length, phone format, recipients array size, data value length)
500 Request acceptance failure, or a retry of a previously failed request_id