Skip to main content

Overview

Send a single SMS message to a specific phone number. This is the most basic SMS sending functionality.

Endpoint

curl --request POST \
  "https://sms.lamah.com/api/sms/messages" \
  --header "Authorization: Bearer YOUR_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "message": "تم تأكيد موعد معاينة العقار يوم الثلاثاء 4:30 مساءً في حي الأندلس - طرابلس. للالغاء رد بـ 0",
    "sender": "RealEstate",
    "payment_type": "wallet",
    "receiver": "00218912345678"
  }'

Request Parameters

ParameterTypeRequiredDescription
messagestringThe SMS message content to send
senderstringThe sender ID (up to 11 characters)
payment_typestringPayment method: wallet or subscription
receiverstringThe recipient’s phone number in international format

Parameter Details

The text content of your SMS message.
  • Maximum length: 160 characters for single SMS, 1530 characters for concatenated SMS
  • Encoding: UTF-8 supported for international characters
  • Special characters: Emojis and special characters count as multiple characters
The sender ID that will appear on the recipient’s device.
  • Length: Maximum 11 characters
  • Format: Alphanumeric characters only
  • Examples: Lamah, MyCompany, Alert123
Specifies how the SMS cost will be charged.
  • wallet: Deduct from your account balance
  • subscription: Use your subscription plan credits
The recipient’s phone number in international format.
  • Format: Must include country code (e.g., 00218912345678)
  • Validation: Number will be validated before sending
  • Examples: 00218913456789, 00218923456789, 00218943456789

Response

Success Response (200 OK)

{
  "message_id": "msg_123456789",
  "cost": 1
}

Response Fields

FieldTypeDescription
message_idstringUnique identifier for the sent message
costnumberNumber of SMS parts charged for this send

Error Responses

400 Bad Request

{ "message": "Invalid phone number" }

401 Unauthorized

{
  "message": "Unauthenticated."
}

Message Status Tracking

After sending a message, you can track its delivery status using the Get Message endpoint with the returned message_id. Possible status values:
  • sent: Message has been sent to the carrier
  • delivered: Message has been delivered to the recipient
  • failed: Message delivery failed
  • pending: Message is being processed

Best Practices

Character Limits: Keep messages under 160 characters to avoid additional charges for multi-part messages.
Rate Limits: This endpoint is limited to 100 requests per minute. For bulk messaging, use the Bulk SMS endpoint.