Everything you need to integrate OTP voice calls into your application. From getting your API key to handling webhooks — complete with code examples in Node.js, Python, PHP, and Java.
This guide walks you through integrating the Tetrax Call API from start to finish. By the end, your application will be able to deliver OTP codes via automated voice calls to any phone number — including feature phones and landlines.
A single POST request sends the OTP. The call is placed automatically.
No app, no data connection, no smartphone required. Works on landlines too.
Each number is spoken individually — no confusion between "five" and "nine".
Get instant delivery updates via webhooks or poll the API for status.
Monitor call volumes, success rates, and delivery trends in real time.
Works with any language. REST API with examples for Node.js, Python, PHP, and Java.
Before you start, make sure you have the following:
Your API key authenticates every request. Each application gets its own key prefixed with trx_call_.
trx_call_ API key shown in the success bannerLet's send a test OTP using cURL. Replace the API key and phone number with your own values.
Expected response:
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Yes | Recipient phone number with country code. E.g., +919876543210 for India. Supports international numbers. |
| otp | string | Yes | The OTP code to deliver. Must be a 3–10 digit numeric string. Each digit is spoken individually. |
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the OTP call was successfully initiated. |
| callId | string | Unique identifier for this OTP call. Use this to track status via webhooks or API. |
| message | string | Human-readable status message. |
| simulated | boolean | True if the call is simulated (test mode without actual provider). |
| call.id | integer | Database ID of the call record. |
| call.phone | string | The phone number the call was sent to. |
| call.otp | string | The OTP that was sent (for your records). |
| call.status | string | Initial status: "initiated". |
| call.called_at | string (ISO 8601) | Timestamp when the call was initiated. |
The OTP verification flow is handled entirely on your end. Here's how the full authentication flow works:
User submits their phone number into your login/signup form.
Generate a random numeric OTP (e.g., 4324). Store it in your database with the phone number and an expiry time (recommended: 5 minutes).
Send a POST request to /v1/call/otp with the phone and OTP. The call is placed automatically.
The user's phone rings. When they answer, they hear each digit spoken individually.
The user types the OTP they heard into your verification form.
Compare the user-entered OTP against the stored value. Check expiry. If valid, grant access.
Webhooks notify your backend in real time when the status of an OTP call changes. This lets you track delivery without polling the API.
Create an endpoint on your server that receives POST requests. Tetrax will send status updates to this URL whenever the call status changes.
| Event | Description | Action to Take |
|---|---|---|
| initiated | Call has been queued | Log the event. No action needed. |
| ringing | Phone is ringing | Log the event. |
| answered | User answered the call | Log the event. OTP is being delivered. |
| completed | Call ended successfully | Mark as delivered. OTP was read to user. |
| failed | Provider error | Consider SMS fallback or retry. |
| busy | Line was busy | Consider retrying after a delay. |
| no-answer | User did not answer | Consider SMS fallback or retry. |
| Parameter | Type | Description |
|---|---|---|
| call_id | string | The unique call ID returned when you initiated the OTP call. |
| status | string | Current status: initiated, ringing, answered, completed, failed, busy, or no-answer. |
| duration | integer | Call duration in seconds. Only present for answered/completed calls. |
Complete, production-ready code snippets for integrating the Call API into your backend.
The Tetrax dashboard gives you full visibility into your OTP voice call activity. Monitor delivery rates, troubleshoot failures, and track usage for billing.
View every OTP call with status, duration, and timestamps. Filter by status or date range.
OpenTrack total calls, success rates, failed deliveries, and daily trends with visual charts.
OpenTest the API interactively — send OTP calls and see responses in real time.
OpenMonitor your call usage and wallet charges in real time.
OpenNever hard-code API keys or commit them to version control. Use environment variables or a secrets manager. Rotate keys periodically from the dashboard.
Always set an expiry time (recommended: 5 minutes) on OTPs stored in your database. This prevents replay attacks and reduces security risk.
Voice calls may not always be answered. Use webhooks to detect failed/no-answer calls and fall back to SMS OTP delivery automatically.
Implement your own rate limiting per user (e.g., max 3 OTP requests per minute) to prevent abuse. The Tetrax API has platform-level rate limits per account tier, but app-level limits add an extra layer of protection.
Log all OTP requests, deliveries, and verification attempts for auditing and troubleshooting. The Tetrax dashboard provides API-side logs, but your own logs give you full control.
Always use phone numbers in international format with the + prefix and country code (e.g., +919876543210 for India, +14155552671 for US). This ensures correct routing for all countries.
x-api-key header (not Authorization: Bearer)trx_call_phone is a string with country code (e.g., +919876543210)otp is a numeric string between 3 and 10 digitsContent-Type: application/json header is setRetry-After seconds before sending another request.Simulated calls occur in test mode or during initial provisioning. If you see"simulated": true in the response, the call was logged but not actually placed. Contact support to activate live calling for your account.
View the complete Call API reference with all endpoints, parameters, and error codes.
Sign in to your dashboard and send your first OTP voice call from the playground.
Was this guide helpful?
Help us improve our documentation.