SMS API for Sri Lanka
Send SMS from your own software.
A small REST API with bearer keys. Build against test keys that behave exactly like live ones, but never reach a phone.
Send a message
curl https://api.loyvo.lk/v1/sms/send \
-H "Authorization: Bearer lvo_test_xxxxxxxx" \
-H "Idempotency-Key: order-1055" \
-H "Content-Type: application/json" \
-d '{
"sender_id": "LOYVO",
"to": "0771234567",
"message": "Your order A-101 is ready for pickup."
}'Personalise a campaign
POST /v1/sms/bulk
{
"sender_id": "LOYVO",
"name": "Order ready",
"message": "Hi {{name}}, order {{order}} is ready.",
"recipients": [
{ "to": "0771234567", "vars": { "name": "Kamal", "order": "A-101" } },
{ "to": "0712345678", "vars": { "name": "Nimal", "order": "A-102" } }
]
}Built for production
The details that matter when money and messages are involved.
Test keys
lvo_test_ keys validate and respond exactly like live keys on the SMS API. Messages are marked delivered, but never sent.
Safe retries
Send an Idempotency-Key and repeated requests within 24 hours return the first response. Nothing is sent twice.
Any number format
0771234567, +94 77 123 4567 or 94771234567. All are accepted and returned in one standard format.
Clear errors
Every error has a stable code, a message, the field at fault and a request ID for support.
Endpoints
API at a glance
| Method | Path | What it does |
|---|---|---|
| POST | /v1/sms/send | Send one message to up to 100 numbers, now or scheduled |
| POST | /v1/sms/bulk | Personalised campaign to up to 10,000 numbers |
| GET | /v1/sms/{id} | Status of one message |
| GET | /v1/campaigns/{id} | Progress of a campaign |
| POST | /v1/campaigns/{id}/cancel | Cancel a scheduled campaign |
| GET | /v1/sender-ids | Your approved sender IDs |
Coming next: SDKs for Node.js, Python and PHP, and webhooks for delivery updates. As WhatsApp and Email launch, they'll use the same keys.