TXT MSG .lk
FAST • RELIABLE • EVERYTIME
api SMS API v3

SMS API Documentation

Integrate SMS into your application in minutes. Our v3 REST API delivers messages with 140ms average latency and 99.99% uptime. SDKs available for 6 languages.

Quickstart: Send Your First SMS

Copy and paste these code samples. Replace YOUR_API_KEY with your actual API key.

curl -X POST https://sms.txtmsg.lk/api/v3/sms/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "recipient": "+947XXXXXXXX",
  "sender_id": "YourBrand",
  "type": "plain",
  "message": "Hello from TXTMSG!"
}'

// Response
{
  "status": "success",
  "sid": "SM92f02b34...",
  "delivery_time_ms": 98
}

API Endpoints

Method Endpoint Description
POST /api/v3/sms/send Send a single SMS message
POST /api/v3/sms/bulk Send bulk SMS (up to 10,000 recipients)
GET /api/v3/sms/{sid}/status Get delivery status of a message
GET /api/v3/account/balance Check account balance and usage

Official SDKs

PHP
PHP SDK
Py
Python SDK
JS
Node.js SDK
Java
Java SDK
Go
Go SDK
Rb
Ruby SDK

Start building with the TXTMSG API

Get 1,000 free test credits and full API access. No credit card required.

Full API Reference
Need Help? Chat With Us