Bulk SMS
Send high-volume SMS campaigns with comprehensive validation, real-time processing status, and detailed delivery reports. Perfect for marketing campaigns, notifications, and alerts.
Batch Processing
Process up to 10,000 messages per request with automatic rate limiting
Smart Validation
Pre-flight validation checks all numbers before processing starts
Detailed Reporting
Comprehensive success/failure reports with per-message breakdown
Credit Protection
Credits only deducted for successfully sent messages
Authentication Required
Bulk Processing Notes
- Messages are processed in parallel batches of 100
- Each batch is charged only upon successful sending
- Failed messages are reported with specific error codes
- You can cancel a bulk job while it's processing
10,000
Maximum messages per request
100 KB
Maximum request size
50
Maximum concurrent bulk jobs
24h
Job retention period
Bulk Upload Methods
{"campaignName": "Summer Sale 2024","senderId": "StorePromo","messages": [{"to": "0555539152","message": "Hi John! Get 20% off today with code SAVE20","reference": "cust_12345"},{"to": "0241234567","message": "Hi Sarah! Flash sale - 30% off all items!","reference": "cust_67890"},{"to": "0209876543","message": "Hi Mike! Limited time offer - Buy 1 Get 1 Free","reference": "cust_24680"}],"options": {"scheduledFor": "2024-01-16T09:00:00Z","priority": "high","webhookUrl": "https://api.myapp.com/webhooks/bulk-status"}}
Request Schema
interface BulkSMSRequest {/** Campaign name for reporting (optional) */campaignName?: string;/** Default sender ID for all messages */senderId: string;/** Array of messages (max 10,000) */messages: Array<{to: string; // Phone numbermessage: string; // Message contentreference?: string; // Your internal referencesenderId?: string; // Override default sender}>;/** Processing options */options?: {scheduledFor?: string; // ISO 8601 timestamppriority?: 'high' | 'normal' | 'low';webhookUrl?: string; // Status updates webhookretryFailed?: boolean; // Auto-retry failedmaxRetries?: number; // Max retry attemptsencoding?: 'gsm' | 'unicode'; // Message encoding};}
Processing Pipeline
Validation
Checking phone numbers and sender IDs
Credit Check
Verifying sufficient balance
Queuing
Adding to processing queue
Processing
Sending to carriers
Reporting
Generating delivery report
Response
{"success": true,"message": "Bulk job accepted for processing","data": {"jobId": "bulk_123456789_abc","status": "processing","totalMessages": 5000,"estimatedCompletion": "2024-01-15T10:35:00Z","progress": 0,"webhookUrl": "https://api.myapp.com/webhooks/bulk-status"}}
2,500/second
Messages per second
4.2s
End-to-end delivery
97.5%
Last 24 hours
1234
Pending messages
Implementation Examples
import requestsimport base64import csvfrom typing import List, Dictimport timeclass BulkSMSManager:def __init__(self, api_key: str, api_secret: str):self.base_url = "https://api.sendexa.co/v1"self.auth = base64.b64encode(f"{api_key}:{api_secret}".encode()).decode()self.headers = {"Authorization": f"Basic {self.auth}","Content-Type": "application/json"}def send_bulk_from_csv(self, csv_path: str, sender_id: str, campaign: str = None):"""Send bulk SMS from CSV file"""messages = []with open(csv_path, 'r') as file:reader = csv.DictReader(file)for row in reader:messages.append({"to": row['phone'],"message": row['message'],"reference": row.get('reference', '')})# Process in batches of 1000batch_size = 1000all_results = []for i in range(0, len(messages), batch_size):batch = messages[i:i + batch_size]payload = {"campaignName": campaign or f"Batch_{i//batch_size}","senderId": sender_id,"messages": batch}# Submit batchresponse = requests.post(f"{self.base_url}/sms/bulk",headers=self.headers,json=payload)result = response.json()if result.get('success'):job_id = result['data']['jobId']print(f"Batch {i//batch_size + 1} submitted: {job_id}")# Monitor this batchbatch_result = self.monitor_bulk_job(job_id)all_results.append(batch_result)else:print(f"Batch failed: {result.get('message')}")return self.aggregate_results(all_results)def monitor_bulk_job(self, job_id: str, poll_interval: int = 5):"""Monitor bulk job until completion"""while True:response = requests.get(f"{self.base_url}/sms/bulk/{job_id}",headers=self.headers)data = response.json()status = data['data']['status']progress = data['data'].get('progress', 0)print(f"Job {job_id}: {status} - {progress}% complete")if status in ['completed', 'failed']:return data['data']time.sleep(poll_interval)def aggregate_results(self, results: List[Dict]) -> Dict:"""Aggregate results from multiple batches"""aggregated = {"total_messages": 0,"successful": 0,"failed": 0,"total_credits": 0}for result in results:aggregated["total_messages"] += result.get("totalMessages", 0)aggregated["successful"] += result.get("successful", 0)aggregated["failed"] += result.get("failed", 0)aggregated["total_credits"] += result.get("totalCreditsUsed", 0)aggregated["success_rate"] = f"{(aggregated['successful'] / aggregated['total_messages'] * 100):.1f}%"return aggregated# Usagemanager = BulkSMSManager('api_key', 'api_secret')results = manager.send_bulk_from_csv('campaign.csv', 'StorePromo', 'SummerSale')print(results)
Best Practices for Bulk SMS
Do's
- ✓ Validate phone numbers before submitting
- ✓ Use reference IDs for tracking responses
- ✓ Implement webhooks for status updates
- ✓ Split large campaigns into batches
- ✓ Monitor credit balance before sending
Don'ts
- ✗ Don't send during restricted hours (9pm-6am)
- ✗ Don't use special characters in sender IDs
- ✗ Don't exceed 1530 characters per message
- ✗ Don't ignore failed message reports
- ✗ Don't retry failed messages without analysis
Performance Optimization Tips
Batch Size Optimization
Optimal batch size is 500-1000 messages per request. Larger batches may timeout, smaller batches increase API calls.
Schedule Smartly
Schedule campaigns during business hours (8am-8pm) for best delivery rates. Avoid Monday mornings and Friday evenings.
Pre-validation
Validate all numbers client-side before submitting to reduce failures and save time.
Advanced Features
A/B Testing
Test different message variants with automatic winner selection
Dynamic Segmentation
Automatically segment recipients based on delivery patterns
Export Reports
Download detailed CSV reports of all bulk operations