curl -X POST "https://sendazi.com/api/v1/voice-campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "name=Audio Announcement" \
-F "group_ids[]=ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8" \
-F "sender_id=MYCOMPANY" \
-F "audio=@/path/to/audio.mp3"
curl -X POST "https://sendazi.com/api/v1/voice-campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Important Announcement",
"group_ids": ["ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8"],
"sender_id": "MYCOMPANY",
"message": "Hello, this is an important announcement from our company."
}'
const formData = new FormData();
formData.append('name', 'Audio Announcement');
formData.append('group_ids[]', 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8');
formData.append('sender_id', 'MYCOMPANY');
formData.append('audio', audioFile); // File object
const response = await fetch('https://sendazi.com/api/v1/voice-campaigns', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
import requests
with open('/path/to/audio.mp3', 'rb') as audio_file:
response = requests.post(
'https://sendazi.com/api/v1/voice-campaigns',
headers={
'Authorization': 'Bearer YOUR_API_KEY'
},
data={
'name': 'Audio Announcement',
'group_ids[]': 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8',
'sender_id': 'MYCOMPANY'
},
files={
'audio': audio_file
}
)
print(response.json())
$curl = curl_init();
$postFields = [
'name' => 'Audio Announcement',
'group_ids[]' => 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8',
'sender_id' => 'MYCOMPANY',
'audio' => new CURLFile('/path/to/audio.mp3', 'audio/mpeg', 'audio.mp3')
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://sendazi.com/api/v1/voice-campaigns',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
],
CURLOPT_POSTFIELDS => $postFields
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"success": true,
"data": {
"id": 2,
"uuid": "9c026029-25e7-5d3b-b3dg-g7d4e9ecd956",
"name": "Audio Announcement",
"total_recipients": 25,
"messages_sent": 0,
"credits_used": "0.00",
"status": "pending",
"audio_url": "https://sendazi.com/storage/audio/9c026029.mp3",
"created_at": "2026-01-15T11:00:00.000000Z",
"updated_at": "2026-01-15T11:00:00.000000Z"
}
}
{
"success": false,
"message": "The given data was invalid.",
"errors": {
"audio": ["The audio must be a file of type: mp3, wav, ogg."],
"message": ["The message field is required when audio is not present."]
}
}
Voice Campaigns
Create Voice Campaign
Create a new voice campaign to broadcast messages to your contacts
POST
https://sendazi.com/api/v1
/
voice-campaigns
curl -X POST "https://sendazi.com/api/v1/voice-campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "name=Audio Announcement" \
-F "group_ids[]=ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8" \
-F "sender_id=MYCOMPANY" \
-F "audio=@/path/to/audio.mp3"
curl -X POST "https://sendazi.com/api/v1/voice-campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Important Announcement",
"group_ids": ["ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8"],
"sender_id": "MYCOMPANY",
"message": "Hello, this is an important announcement from our company."
}'
const formData = new FormData();
formData.append('name', 'Audio Announcement');
formData.append('group_ids[]', 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8');
formData.append('sender_id', 'MYCOMPANY');
formData.append('audio', audioFile); // File object
const response = await fetch('https://sendazi.com/api/v1/voice-campaigns', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
import requests
with open('/path/to/audio.mp3', 'rb') as audio_file:
response = requests.post(
'https://sendazi.com/api/v1/voice-campaigns',
headers={
'Authorization': 'Bearer YOUR_API_KEY'
},
data={
'name': 'Audio Announcement',
'group_ids[]': 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8',
'sender_id': 'MYCOMPANY'
},
files={
'audio': audio_file
}
)
print(response.json())
$curl = curl_init();
$postFields = [
'name' => 'Audio Announcement',
'group_ids[]' => 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8',
'sender_id' => 'MYCOMPANY',
'audio' => new CURLFile('/path/to/audio.mp3', 'audio/mpeg', 'audio.mp3')
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://sendazi.com/api/v1/voice-campaigns',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
],
CURLOPT_POSTFIELDS => $postFields
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"success": true,
"data": {
"id": 2,
"uuid": "9c026029-25e7-5d3b-b3dg-g7d4e9ecd956",
"name": "Audio Announcement",
"total_recipients": 25,
"messages_sent": 0,
"credits_used": "0.00",
"status": "pending",
"audio_url": "https://sendazi.com/storage/audio/9c026029.mp3",
"created_at": "2026-01-15T11:00:00.000000Z",
"updated_at": "2026-01-15T11:00:00.000000Z"
}
}
{
"success": false,
"message": "The given data was invalid.",
"errors": {
"audio": ["The audio must be a file of type: mp3, wav, ogg."],
"message": ["The message field is required when audio is not present."]
}
}
This endpoint accepts
multipart/form-data when uploading an audio file, or application/json when using text-to-speech.string
required
Name of the campaign for identification
array
Array of phone numbers (international, local, or with + prefix). Either
recipients or group_ids must be provided.array
Array of group UUIDs to target. Either
recipients or group_ids must be provided.string
required
Your approved sender ID
file
Audio file to broadcast (MP3, WAV, OGG). Either
audio or message must be provided.string
Text message to be converted to speech (text-to-speech). Either
audio or message must be provided.string
Schedule the campaign for a future time. Format:
YYYY-MM-DD HH:MM:SSboolean
default:"false"
Enable recurring campaign
string
Frequency of recurrence:
daily, weekly, or monthlyinteger
default:"1"
Interval between recurrences
string
End date for recurring campaign
Audio File Requirements
| Format | Max Size | Max Duration |
|---|---|---|
| MP3 | 10 MB | 5 minutes |
| WAV | 10 MB | 5 minutes |
| OGG | 10 MB | 5 minutes |
curl -X POST "https://sendazi.com/api/v1/voice-campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "name=Audio Announcement" \
-F "group_ids[]=ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8" \
-F "sender_id=MYCOMPANY" \
-F "audio=@/path/to/audio.mp3"
curl -X POST "https://sendazi.com/api/v1/voice-campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Important Announcement",
"group_ids": ["ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8"],
"sender_id": "MYCOMPANY",
"message": "Hello, this is an important announcement from our company."
}'
const formData = new FormData();
formData.append('name', 'Audio Announcement');
formData.append('group_ids[]', 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8');
formData.append('sender_id', 'MYCOMPANY');
formData.append('audio', audioFile); // File object
const response = await fetch('https://sendazi.com/api/v1/voice-campaigns', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
import requests
with open('/path/to/audio.mp3', 'rb') as audio_file:
response = requests.post(
'https://sendazi.com/api/v1/voice-campaigns',
headers={
'Authorization': 'Bearer YOUR_API_KEY'
},
data={
'name': 'Audio Announcement',
'group_ids[]': 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8',
'sender_id': 'MYCOMPANY'
},
files={
'audio': audio_file
}
)
print(response.json())
$curl = curl_init();
$postFields = [
'name' => 'Audio Announcement',
'group_ids[]' => 'ee9fb0b4-83f0-4be5-a0be-1063e05ff0b8',
'sender_id' => 'MYCOMPANY',
'audio' => new CURLFile('/path/to/audio.mp3', 'audio/mpeg', 'audio.mp3')
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://sendazi.com/api/v1/voice-campaigns',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
],
CURLOPT_POSTFIELDS => $postFields
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"success": true,
"data": {
"id": 2,
"uuid": "9c026029-25e7-5d3b-b3dg-g7d4e9ecd956",
"name": "Audio Announcement",
"total_recipients": 25,
"messages_sent": 0,
"credits_used": "0.00",
"status": "pending",
"audio_url": "https://sendazi.com/storage/audio/9c026029.mp3",
"created_at": "2026-01-15T11:00:00.000000Z",
"updated_at": "2026-01-15T11:00:00.000000Z"
}
}
{
"success": false,
"message": "The given data was invalid.",
"errors": {
"audio": ["The audio must be a file of type: mp3, wav, ogg."],
"message": ["The message field is required when audio is not present."]
}
}
Was this page helpful?
⌘I
