Back to Developer Help
7
Bulk Messaging
Send SMS messages to multiple recipients in a single API call.
Endpoint
POST
/api/v1/bulk-messages
Requires authentication (X-API-Key)
Request Body
| Field | Type |
|---|---|
| from | string (E.164, registered sender phone) |
| recipients | array of strings (E.164 numbers) |
| content | string (message text) |
Common Error Responses
403
FORBIDDEN
Sender phone is not registered to your account.
Code Samples
curl -X POST https://api.palmtext.com/api/v1/bulk-messages \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"from": "+15550001234", "recipients": ["+15550005678", "+15550009999"], "content": "Bulk message"}'
import requests
resp = requests.post(
'https://api.palmtext.com/api/v1/bulk-messages',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={
'from': '+15550001234',
'recipients': ['+15550005678', '+15550009999'],
'content': 'Bulk message'
}
)
print(resp.json())
const res = await fetch('https://api.palmtext.com/api/v1/bulk-messages', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
from: '+15550001234',
recipients: ['+15550005678', '+15550009999'],
content: 'Bulk message'
})
});
const data = await res.json();
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.palmtext.com/api/v1/bulk-messages',
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'from' => '+15550001234',
'recipients' => ['+15550005678', '+15550009999'],
'content' => 'Bulk message'
]),
CURLOPT_RETURNTRANSFER => true,
]);
$resp = curl_exec($ch);
echo $resp;
curl_close($ch);
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]interface{}{
"from": "+15550001234",
"recipients": []string{"+15550005678", "+15550009999"},
"content": "Bulk message",
})
req, _ := http.NewRequest("POST",
"https://api.palmtext.com/api/v1/bulk-messages", bytes.NewBuffer(body))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
fmt.Println(resp.Status)
}