SMS
Send SMS to Contact Group
Send an SMS to all contacts in a saved contact group
Endpoint
POST /api/sms/messages/contactsRequest 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 |
contact_group_id | string (UUID) | Yes | ID of the contact group |
Example
curl -X POST https://sms.lamah.com/api/sms/messages/contacts \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "Your monthly statement is ready.",
"sender": "MyBank",
"payment_type": "wallet",
"contact_group_id": "0198faa2-8ddd-72c7-afce-32d980bd60fe"
}'Response
{
"message_id": "b9e8a1f2-4c60-4b0b-9f51-0c4f2f6c9e7a",
"cost": 27,
"details": {
"sent": 27,
"total": 30
}
}| Field | Description |
|---|---|
message_id | UUID of the created message batch |
cost | Total cost computed as parts × total contacts in the group |
details.sent | Count of recipients compatible with the sender provider |
details.total | Total contacts in the group |
The cost field is computed as parts × total contacts in the group. Actual wallet/subscription consumption is applied only to compatible recipients.
Error responses
400 Bad Request — Group not found
{ "message": "Contact group not found" }400 Bad Request — Incompatible sender/receivers
{ "message": "The sender and receivers are not compatible." }401 Unauthorized
{ "message": "Unauthenticated." }402 Payment Required
{ "message": "Insufficient balance" }Getting a contact group ID
Find group IDs from the dashboard under Contacts → Groups, or via the List Project Contacts endpoint.