SMS
Send SMS Message
Send a single SMS message to one recipient
Endpoint
POST /api/sms/messagesRequest body
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The SMS message content to send (max 1530 chars for concatenated SMS) |
sender | string | Yes | Sender ID (max 11 alphanumeric chars) |
payment_type | string | Yes | wallet or subscription |
receiver | string | Yes | Phone number in international format (e.g., 00218912345678) |
Example
curl -X POST https://sms.lamah.com/api/sms/messages \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "Your appointment is confirmed for Tuesday at 4:30 PM.",
"sender": "MyBusiness",
"payment_type": "wallet",
"receiver": "00218912345678"
}'Response
{
"message_id": "msg_123456789",
"cost": 1
}| Field | Description |
|---|---|
message_id | Unique identifier for the sent message |
cost | Number of SMS parts charged for this send |
Error responses
400 Bad Request
{ "message": "Invalid phone number" }401 Unauthorized
{ "message": "Unauthenticated." }Messages longer than 160 characters are split into multiple SMS segments. Each segment costs 1 unit. Maximum message length is 1530 characters.