SMS
Send Bulk SMS
Send the same SMS message to up to 1000 recipients at once
Endpoint
POST /api/sms/messages/bulkRequest body
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message content (max 1530 chars for concatenated SMS) |
sender | string | Yes | Sender ID (max 11 alphanumeric chars) |
payment_type | string | Yes | wallet or subscription |
receivers | array | Yes | Array of phone numbers in international format (max 1000) |
Example
curl -X POST https://sms.lamah.com/api/sms/messages/bulk \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "Your order has been shipped.",
"sender": "MyShop",
"payment_type": "wallet",
"receivers": [
"00218912345678",
"00218922654321",
"00218944678901"
]
}'Response
{
"message_id": "batch_123456789",
"cost": 3,
"details": {
"sent": 3,
"total": 3
}
}| Field | Description |
|---|---|
message_id | Unique identifier for the bulk send batch |
cost | Total cost for all messages |
details.sent | Number of messages successfully sent |
details.total | Total number of recipients |
Error responses
401 Unauthorized
{ "message": "Unauthenticated." }Sending to more than 1000 recipients
Split your list into chunks:
const chunk = (arr, size) =>
Array.from({ length: Math.ceil(arr.length / size) }, (_, i) =>
arr.slice(i * size, i * size + size)
);
for (const batch of chunk(allReceivers, 1000)) {
await sendBulk({ ...payload, receivers: batch });
await new Promise(r => setTimeout(r, 6000)); // wait between batches
}Duplicate numbers are automatically removed. Maximum 1000 recipients per request.