How to Send a Voice Message
Sending a Voice Message via API
Send pre-recorded voice messages to multiple recipients using the LigueLead API's two-step process.
📋 Prerequisites
- Valid
api-tokenandapp-idfrom your LigueLead account - Audio file (supported formats: MP3, WAV, etc.)
- Target phone numbers in Brazilian format (multiple formats accepted).
🎵 Step 1: Upload Your Audio File
First, upload the audio file you want to send.- Valid api-token and app-id from your LigueLead account
Endpoint: POST /v1/voice/uploads- Audio file (supported formats: MP3, WAV, etc.)
Request Example - Target phone numbers in Brazilian format (multiple formats accepted)
curl -X POST "https://api.liguelead.com.br/v1/voice/uploads" \
-H "api-token: YOUR_API_TOKEN" \
-H "app-id: YOUR_APP_ID" \
-F "title=Welcome Message" \
-F "file=@/path/to/your/audio.mp3"Response
{
"message": "Voice upload successful.",
"data": {
"id": 436514,
"title": "Welcome Message"
}
}💡 Tip: Save the returned id (436514 in this example) - you'll need it for sending the message.curl -X POST "https://api.liguelead.com.br/v1/voice/uploads" \
📤 Step 2: Send the Voice Message
Use the audio ID from Step 1 to send your voice message. -H "app-id: YOUR_APP_ID" \
Endpoint: POST /v1/voice -F "title=Welcome Message" \
Request Example
curl -X POST "https://api.liguelead.com.br/v1/voice" \
-H "api-token: YOUR_API_TOKEN" \
-H "app-id: YOUR_APP_ID" \
-H "Content-Type: application/json" \### Response
-d '{
"title": "Welcome Campaign",
"voice_upload_id": 436514,
"phones": ["11999999999", "+5511888888888"],```json**Endpoint:** `POST /v1/voice/uploads`- Audio file (supported formats: MP3, WAV, etc.)
"group_id": "optional-group-id"
}'Response
{
"message": "Voice accepted successfully",
"data": {
"campaign_id": "3b4f7c5e-7e2d-4157-b542-5eb2155455c5",
"accepted_at": "2025-12-29T18:34:38.961Z"
}
}📋 Request Parameters
Upload Audio (POST /v1/voice/uploads)
POST /v1/voice/uploads)| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | ✅ | Descriptive name for your audio file |
file | binary | ✅ | Audio file (multipart/form-data) |
Send Voice Message (POST /v1/voice)
POST /v1/voice)| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | ✅ | Campaign identifier |
voice_upload_id | integer | ✅ | ID from the upload response |
phones | array | ✅ | Brazilian phone numbers (multiple formats accepted) |
group_id | string | ❌ | Optional group identifier for organization |
🔍 Managing Uploaded Audio Files
List All Uploaded Files
curl -X GET "https://api.liguelead.com.br/v1/voice/uploads" \ -H "Content-Type: application/json" \### Response
-H "api-token: YOUR_API_TOKEN" \
-H "app-id: YOUR_APP_ID" Get Specific Audio File
curl -X GET "https://api.liguelead.com.br/v1/voice/uploads/436514" \
-H "api-token: YOUR_API_TOKEN" \
-H "app-id: YOUR_APP_ID" 📱 Phone Number Format
The API accepts Brazilian phone numbers in multiple formats:
✅ National Format:
- São Paulo:
"11999999999" - Rio de Janeiro:
"21999999999" - Brasília:
"61999999999"
✅ International Format:
- São Paulo:
"+5511999999999" - Rio de Janeiro:
"+5521999999999" - Brasília:
"+5561999999999"
✅ DDI Format:
- São Paulo:
"5511999999999" - Rio de Janeiro:
"5521999999999" - Brasília:
"5561999999999"
⏰ Dialing Window (10:00 PM – 08:00 AM | America/Sao_Paulo)
To comply with calling time policies, the system applies a control window for new voice requests.
Requests received until 21:59 (America/Sao_Paulo) may be dialed normally, following the standard queue processing.
Starting at 22:00, new requests are still accepted by the API but will not be dialed immediately. These requests will remain pending and will be processed automatically when dialing resumes at 08:00.
After 22:00, no calls are placed until dialing resumes at 08:00.
⚡ Processing & Delivery
- Asynchronous Processing: Voice messages are queued for delivery
- Response Code:
202 Acceptedindicates successful queuing - Delivery Time: Varies based on carrier and number of recipientsMonitor the delivery status of your voice campaign.
- Status Tracking: Use Campaign endpoints to monitor progress
🚀 Best Practices
- Reuse Audio Files: Upload once, send to multiple campaigns
- Organize with Groups: Use
group_idto categorize related campaigns - Monitor Delivery: Check campaign status for delivery confirmation
- Test First: Start with small batches before scaling up```bash
- Clear Titles: Use descriptive names for easy identification
🛠️ Troubleshooting
| Issue | Solution |
|---|---|
| File upload fails | Check file format and size limits |
| Invalid phone format | Ensure valid Brazilian phone number format (11 digits or with DDI) |
| Authentication error | Verify api-token and app-id headers |
| Voice not found | Confirm voice_upload_id exists in uploads |
Updated 10 days ago
