ConnexBetter LogoConnexBetter
← Developer Hub
REST APIv1 Stable

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
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_KEY

Generate your API key from Dashboard → Settings → API Keys. Never expose your API key in client-side code.

Base URL

https://api.connexbetter.com/v1

All 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.

POST
/v1/sms/send

Send a single SMS message

Core
POST
/v1/sms/send-bulk

Send SMS to multiple recipients in one request

Core
GET
/v1/sms/status/:messageId

Get delivery status for a specific message

Core
GET
/v1/sms/reports

Get delivery reports for a date range

Reporting
POST
/v1/otp/send

Send an OTP via SMS with automatic verification

OTP
POST
/v1/otp/verify

Verify an OTP submitted by the user

OTP
GET
/v1/sms/balance

Get your current SMS credit balance

Account

Send SMS — Request Parameters

ParameterTypeRequiredDescription
tostringYesRecipient phone number in E.164 format (+91XXXXXXXXXX)
fromstringYesYour DLT-registered 6-character sender ID (e.g. CONNEXB)
messagestringYesSMS content. Max 160 chars per part (Unicode: 70 chars/part)
typestringYes'transactional' or 'promotional'. Transactional bypasses DND.
dlt_te_idstringYesDLT Template Entity ID from TRAI DLT portal
unicodebooleanNoSet true for regional language SMS. Default: false
flashbooleanNoSet true to send as flash SMS. Default: false
callback_urlstringNoWebhook URL for delivery report notifications
scheduled_atstringNoISO 8601 datetime to schedule message delivery

Response Format

200 OK — Success Response
{
  "success": true,
  "messageId": "msg_01HXYZ123456",
  "to": "+919876543210",
  "from": "CONNEXB",
  "status": "queued",
  "credits": 1,
  "timestamp": "2025-09-15T10:30:00Z"
}

Code Examples

python
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']}")
Node.js
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
<?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 CodeErrorDescription
400Bad RequestMissing required parameters or invalid format
401UnauthorizedInvalid or missing API key
402Insufficient CreditsAccount does not have enough SMS credits
422DLT Not RegisteredSender ID or template not registered on DLT
429Rate LimitedToo many requests — reduce request frequency
500Server ErrorInternal error — retry with exponential backoff

SDKs & Libraries

Python

pip install connexbetter

Node.js

npm install connexbetter-sdk

PHP

composer require connexbetter/sdk

Java

Maven: com.connexbetter:sdk:1.x

Go

go get github.com/connexbetter/go-sdk

Ruby

gem install connexbetter

Delivery 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.queued

Message accepted and queued

sms.delivered

Message delivered to handset

sms.failed

Delivery 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.