Send SMS
Send an SMS message to a mobile phone number. Messages are queued and processed asynchronously with delivery status tracking.
This endpoint requires an approved sender name. See SMS Overview for setup instructions.
Path Parameters
Language code (e.g., lt, en)
Authentication
API key from Partners Portal
API secret from Partners Portal
Request Body
Required Fields
Origin sender name (alphatag). Must be pre-approved in Partners Portal.Requirements:
- Alphanumeric only (letters, numbers, spaces)
- Maximum 11 characters
- Must be approved for your account
Example: "Loyalty", "MyBrand"
Target mobile number in E.164 format (with country code).Example: "+37061234567", "37061234567"
Message text to send. Maximum 1600 characters.Long messages are split into multiple parts and billed accordingly.
Optional Fields
Request delivery receipt. If true, status updates will be sent to receiptURL.
Callback URL for delivery receipt webhook. Required when receipt: true.There is no default webhook URL. You must provide receiptURL with every request to receive delivery updates.
Example: "https://your-site.com/sms-webhook"
Schedule message for future delivery. ISO 8601 format.Example: "2025-01-15T10:30:00Z"
Message expiry time. If not delivered by this time, message is discarded. ISO 8601 format.Example: "2025-01-15T23:59:59Z"
Alternative to validity. Number of minutes until message expires.Range: 1-10080 (7 days max)Example: 1440 (24 hours)
Marketing Consent (GDPR)
If true, registers that the recipient has consented to receive marketing messages from you.
The actual IP address of the end user/client who gave consent. Required for GDPR compliance.Example: "192.168.1.100"
Browser/device user agent string of the person who gave consent.Example: "Mozilla/5.0 (Windows NT 10.0; Win64; x64)..."
URL of the page where consent was obtained.Example: "https://example.com/subscribe"
Response
Whether the message was queued successfully
Unique message identifier for status tracking
Normalized recipient number
Number of message parts (for long messages)
Scheduled delivery time (if provided)
marketing_consent_registered
Whether consent was registered with this message
curl -X POST "https://api.loyalty.lt/lt/sms/send" \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key" \
-H "X-API-Secret: your_api_secret" \
-d '{
"source": "MyBrand",
"destination": "+37061234567",
"message": "Sveiki! Jūsų užsakymas #12345 išsiųstas."
}'
{
"success": true,
"message": "SMS sent successfully",
"data": {
"message_id": "msg_abc123def456",
"source": "MyBrand",
"destination": "+37061234567",
"status": "queued",
"parts": 1,
"cost": {
"amount": 0.0556,
"currency": "EUR",
"parts_charged": 1
},
"scheduled": null,
"validity": "2025-01-16T10:30:00Z",
"marketing_consent_registered": false
},
"code": 200
}
Message Parts Calculation
Messages are split based on character encoding:
GSM-7 (Standard Latin Characters)
Characters: A-Z, a-z, 0-9, space, and: @£$¥èéùìòÇØøÅåΔ_ΦΓΛΩΠΨΣΘΞ^{}\\[~]|€ÆæßÉ!"#¤%&'()*+,-./:;<=>?¡ÄÖÑܧ¿äöñüà
| Message Length | Parts |
|---|
| 1-160 chars | 1 part |
| 161-306 chars | 2 parts |
| 307-459 chars | 3 parts |
Unicode (Non-Latin Characters, Emoji)
| Message Length | Parts |
|---|
| 1-70 chars | 1 part |
| 71-134 chars | 2 parts |
| 135-201 chars | 3 parts |
To minimize costs, keep messages short and use GSM-7 compatible characters when possible.