إرسال
SMS

Send SMS to Contact Group

Send an SMS to all contacts in a saved contact group

Endpoint

POST /api/sms/messages/contacts

Request body

FieldTypeRequiredDescription
messagestringYesMessage content (max 1530 chars for concatenated SMS)
senderstringYesSender ID (max 11 alphanumeric chars)
payment_typestringYeswallet or subscription
contact_group_idstring (UUID)YesID 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
  }
}
FieldDescription
message_idUUID of the created message batch
costTotal cost computed as parts × total contacts in the group
details.sentCount of recipients compatible with the sender provider
details.totalTotal 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.

On this page