SMS API
Send transactional SMS, bulk SMS, and OTPs programmatically. TRAI DLT-compliant. Pan-India delivery across Jio, Airtel, Vi, and BSNL in under 3 seconds.
Quick Start
Send your first SMS in under 2 minutes. Replace YOUR_API_KEY with your key from the dashboard.
curl -X POST https://api.connexbetter.com/v1/sms/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"from": "CONNEXB",
"message": "Your OTP is 123456. Valid for 10 minutes.",
"type": "transactional",
"dlt_te_id": "1234567890123456789"
}'Authentication
All API requests require a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEYGenerate your API key from Dashboard → Settings → API Keys. Never expose your API key in client-side code.
Base URL
https://api.connexbetter.com/v1All endpoints are relative to this base URL. All requests must use HTTPS.
API Endpoints
All endpoints return JSON. Successful responses return HTTP 2xx status codes.
/v1/sms/sendSend a single SMS message
/v1/sms/send-bulkSend SMS to multiple recipients in one request
/v1/sms/status/:messageIdGet delivery status for a specific message
/v1/sms/reportsGet delivery reports for a date range
/v1/otp/sendSend an OTP via SMS with automatic verification
/v1/otp/verifyVerify an OTP submitted by the user
/v1/sms/balanceGet your current SMS credit balance
Send SMS — Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | Recipient phone number in E.164 format (+91XXXXXXXXXX) |
| from | string | Yes | Your DLT-registered 6-character sender ID (e.g. CONNEXB) |
| message | string | Yes | SMS content. Max 160 chars per part (Unicode: 70 chars/part) |
| type | string | Yes | 'transactional' or 'promotional'. Transactional bypasses DND. |
| dlt_te_id | string | Yes | DLT Template Entity ID from TRAI DLT portal |
| unicode | boolean | No | Set true for regional language SMS. Default: false |
| flash | boolean | No | Set true to send as flash SMS. Default: false |
| callback_url | string | No | Webhook URL for delivery report notifications |
| scheduled_at | string | No | ISO 8601 datetime to schedule message delivery |
Response Format
{
"success": true,
"messageId": "msg_01HXYZ123456",
"to": "+919876543210",
"from": "CONNEXB",
"status": "queued",
"credits": 1,
"timestamp": "2025-09-15T10:30:00Z"
}Code Examples
import requests
response = requests.post(
"https://api.connexbetter.com/v1/sms/send",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"to": "+919876543210",
"from": "CONNEXB",
"message": "Your OTP is 123456. Valid for 10 minutes.",
"type": "transactional",
"dlt_te_id": "1234567890123456789"
}
)
data = response.json()
print(f"Message ID: {data['messageId']}")
print(f"Status: {data['status']}")const axios = require('axios');
const response = await axios.post(
'https://api.connexbetter.com/v1/sms/send',
{
to: '+919876543210',
from: 'CONNEXB',
message: 'Your OTP is 123456. Valid for 10 minutes.',
type: 'transactional',
dlt_te_id: '1234567890123456789'
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log('Message ID:', response.data.messageId);
console.log('Status:', response.data.status);<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.connexbetter.com/v1/sms/send');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'to' => '+919876543210',
'from' => 'CONNEXB',
'message' => 'Your OTP is 123456. Valid for 10 minutes.',
'type' => 'transactional',
'dlt_te_id' => '1234567890123456789'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
echo 'Message ID: ' . $response['messageId'];Error Codes
| HTTP Code | Error | Description |
|---|---|---|
| 400 | Bad Request | Missing required parameters or invalid format |
| 401 | Unauthorized | Invalid or missing API key |
| 402 | Insufficient Credits | Account does not have enough SMS credits |
| 422 | DLT Not Registered | Sender ID or template not registered on DLT |
| 429 | Rate Limited | Too many requests — reduce request frequency |
| 500 | Server Error | Internal error — retry with exponential backoff |
SDKs & Libraries
Python
pip install connexbetterNode.js
npm install connexbetter-sdkPHP
composer require connexbetter/sdkJava
Maven: com.connexbetter:sdk:1.xGo
go get github.com/connexbetter/go-sdkRuby
gem install connexbetterDelivery Report Webhooks
When a message status changes, ConnexBetter POSTs a JSON payload to your webhook URL.
POST https://your-server.com/sms-webhook
{
"event": "sms.delivered",
"messageId": "msg_01HXYZ123456",
"to": "+919876543210",
"status": "delivered",
"timestamp": "2025-09-15T10:30:45Z",
"network": "Jio",
"credits_used": 1
}sms.queuedMessage accepted and queued
sms.deliveredMessage delivered to handset
sms.failedDelivery failed — includes reason
Frequently Asked Questions
What is ConnexBetter's SMS API base URL?
The base URL for all ConnexBetter SMS API requests is https://api.connexbetter.com/v1. All requests must use HTTPS and include a valid Authorization header with your API key.
What authentication method does ConnexBetter SMS API use?
ConnexBetter uses Bearer token authentication. Include your API key in the Authorization header: Authorization: Bearer YOUR_API_KEY. You can generate API keys from your ConnexBetter dashboard under Settings > API Keys.
What is the rate limit for the SMS API?
Rate limits vary by plan: Starter: 100 requests/minute, Professional: 1,000 requests/minute, Enterprise: custom limits. For high-throughput OTP delivery, contact us for dedicated throughput allocations.
How do I receive delivery reports via webhook?
Configure your webhook URL in the ConnexBetter dashboard under Settings > Webhooks. We send a POST request to your URL for every status update (delivered, failed, pending). The payload includes messageId, status, timestamp, and recipient number.
Does the SMS API support TRAI DLT compliance?
Yes. All messages sent through ConnexBetter's SMS API are automatically routed through TRAI DLT-registered sender IDs and templates. You must register your sender ID and message templates on the DLT portal before sending promotional or transactional SMS.
Can I send Unicode (regional language) SMS?
Yes. Set the 'unicode' parameter to true in your API request to send SMS in Hindi, Tamil, Telugu, Bengali, Gujarati, and other regional languages. Unicode SMS supports up to 70 characters per part (vs 160 for standard GSM).
Ready to integrate the SMS API?
Get your API key, explore the dashboard, and send your first SMS in minutes.