ConnexBetter LogoConnexBetter
← Developer Hub
REST APITier-1 Telecom Routing

Voice API & IVR

Programmatic voice calls, IVR menus, OTP delivery via call, and text-to-speech in 9 Indian languages. 92%+ connection rate across Jio, Airtel, Vi, and BSNL.

What You Can Build

🔢

Voice OTP

Deliver one-time passwords via automated call when SMS fails

📞

IVR Menus

Multi-level phone menus with keypress routing

🤖

TTS Notifications

Text-to-speech alerts in Hindi, Tamil, Telugu, and 6 more languages

⏺️

Call Recording

Record outbound and inbound calls with secure storage

🔗

Click-to-Call

Connect website visitors with your team instantly

📊

Call Analytics

Duration, DTMF input, answer rates, and regional breakdowns

Quick Start — TTS Call with DTMF

cURL — TTS Call with Keypress Menu
# Outbound call with text-to-speech
curl -X POST https://api.connexbetter.com/v1/voice/call \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "type": "tts",
    "text": "Hello Rahul, your appointment is confirmed for tomorrow at 2 PM. Press 1 to confirm or 2 to reschedule.",
    "language": "en-IN",
    "record": false,
    "dtmf": {
      "1": { "action": "webhook", "url": "https://your-server.com/confirmed" },
      "2": { "action": "webhook", "url": "https://your-server.com/reschedule" }
    },
    "callback_url": "https://your-server.com/call-status"
  }'

Voice OTP — Send & Verify

cURL — Voice OTP
# Voice OTP delivery
curl -X POST https://api.connexbetter.com/v1/voice/otp/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "language": "hi-IN",
    "expiry": 300
  }'

# Response includes OTP session ID for verification
# {
#   "sessionId": "votp_01HXYZ",
#   "to": "+919876543210",
#   "status": "calling",
#   "expires_at": "2025-09-15T10:35:00Z"
# }

# Verify the OTP entered by user
curl -X POST https://api.connexbetter.com/v1/voice/otp/verify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sessionId": "votp_01HXYZ",
    "otp": "847291"
  }'

Python Example

Python — Voice OTP Flow
import requests

# Initiate a voice OTP call
send_resp = requests.post(
    "https://api.connexbetter.com/v1/voice/otp/send",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "to": "+919876543210",
        "language": "en-IN",
        "expiry": 300
    }
)
session_id = send_resp.json()["sessionId"]

# Later — verify the OTP user entered
verify_resp = requests.post(
    "https://api.connexbetter.com/v1/voice/otp/verify",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"sessionId": session_id, "otp": user_entered_otp}
)

result = verify_resp.json()
if result["verified"]:
    print("OTP verified successfully")
else:
    print("Invalid or expired OTP")

API Endpoints

POST
/v1/voice/call

Initiate an outbound voice call

Core
POST
/v1/voice/otp/send

Deliver OTP via voice call with TTS

OTP
POST
/v1/voice/otp/verify

Verify an OTP delivered via voice

OTP
GET
/v1/voice/call/:callId

Get status and details for a call

Status
GET
/v1/voice/recording/:callId

Get the recording URL for a completed call

Recording
POST
/v1/voice/ivr

Create or update an IVR flow definition

IVR
GET
/v1/voice/reports

Get call analytics for a date range

Reporting

Call Status Webhooks

Webhook Payload — Call Completed
POST https://your-server.com/call-status

{
  "event": "call.completed",
  "callId": "call_01HXYZ",
  "to": "+919876543210",
  "duration": 42,
  "status": "completed",
  "dtmf_input": "1",
  "recording_url": "https://recordings.connexbetter.com/call_01HXYZ.mp3",
  "timestamp": "2025-09-15T10:31:00Z"
}

Supported TTS Languages

en-IN (English)

hi-IN (Hindi)

ta-IN (Tamil)

te-IN (Telugu)

kn-IN (Kannada)

ml-IN (Malayalam)

bn-IN (Bengali)

gu-IN (Gujarati)

mr-IN (Marathi)

Frequently Asked Questions

What types of voice calls can I make with ConnexBetter's Voice API?

ConnexBetter's Voice API supports outbound calls (text-to-speech and pre-recorded audio), IVR (Interactive Voice Response) with DTMF input, OTP delivery via voice call, call recording, conferencing, and click-to-call. Inbound call routing with IVR menus is also supported.

What is DTMF and how does it work in IVR?

DTMF (Dual-Tone Multi-Frequency) is the signal generated when a user presses a key on their phone keypad (0–9, *, #). In an IVR flow, you configure keypress actions (e.g. press 1 for Sales, press 2 for Support), and ConnexBetter captures the input and routes the call or triggers a webhook accordingly.

How does OTP delivery via voice call work?

When SMS delivery fails or the user requests a voice OTP, ConnexBetter dials the user's number and reads the OTP using text-to-speech in the user's preferred language. The API also supports generating the OTP automatically with expiry and verification in a single flow.

What Indian languages does text-to-speech support?

ConnexBetter's TTS engine supports Hindi, Tamil, Telugu, Kannada, Malayalam, Bengali, Gujarati, Marathi, and English with an Indian accent. Language is set per API request using the 'language' parameter.

Can I record calls via the API?

Yes. Set 'record': true in your API request. After the call ends, a recording URL is provided in the webhook callback payload. Recordings are stored for 30 days by default and can be downloaded or deleted via the API.

What is the call quality and deliverability for India?

ConnexBetter routes calls through Tier-1 telecom operators (Jio, Airtel, Vi, BSNL) with TRAI-registered CLI (caller line identification) numbers. Average connection rate for voice OTP is 92%+ in metro areas. Failed calls are automatically retried once after 30 seconds.

Build voice-powered experiences for India

Get your Voice API credentials and start making programmatic calls in minutes.