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)
to array of strings (E.164 numbers, 1 to 5000)
content string (message text)

Common Error Responses

402 INSUFFICIENT_CREDITS

This send needs 2 messages, and the group has 1.

403 ACCOUNT_SUSPENDED

This account is suspended. Contact [email protected].

403 FORBIDDEN

Sender phone is not registered to your account.

409 SIM_MISMATCH

This phone needs to prove its SIM again before it can send.

422 VALIDATION_ERROR

Not a valid international phone number.

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", "to": ["+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',
        'to': ['+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',
    to: ['+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',
    'to' => ['+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",
    "to": []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)
}