Developer API Documentation

Welcome to the OTP Gateway developer portal. Our REST APIs allow you to trigger high-speed OTP validations for mobile numbers in India. We support direct SMS routing and WhatsApp delivery options.

Base API URL: https://otpwallah.in/api/v1

Authentication

All API requests must include your API Key in the request header as a Bearer Token.

Authorization: Bearer ak_YOUR_API_KEY

Send SMS OTP

POST /api/v1/send/sms
Request Body Parameters
Parameter Type Required Description
mobile String Yes 10-digit Indian mobile number. e.g. 9876543210
sender_id String No Valid approved sender ID (default: 275)
otp String No Custom OTP value. If omitted, gateway generates a random OTP.
length Integer No Length of generated OTP (4-8 digits, default: 6)
expiry Integer No Expiry duration in minutes (1-60, default: 10)

Send WhatsApp OTP

POST /api/v1/send/whatsapp
Request Body Parameters
Parameter Type Required Description
mobile String Yes 10-digit Indian mobile number. e.g. 9876543210
otp String No Custom OTP value. (default: auto-generated)
length Integer No OTP Length (4-8 digits, default: 6)

Code Examples

curl -X POST https://otpwallah.in/api/v1/send/sms \
  -H "Authorization: Bearer ak_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mobile": "9876543210",
    "length": 6
  }'
<?php
$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => "https://otpwallah.in/api/v1/send/sms",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => json_encode([
        "mobile" => "9876543210",
        "length" => 6
    ]),
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer ak_YOUR_API_KEY",
        "Content-Type: application/json"
    ],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
?>
use Illuminate\Support\Facades\Http;

$response = Http::withToken('ak_YOUR_API_KEY')
    ->post('https://otpwallah.in/api/v1/send/sms', [
        'mobile' => '9876543210',
        'length' => 6,
    ]);

if ($response->successful()) {
    $result = $response->json();
}
const axios = require('axios');

axios.post('https://otpwallah.in/api/v1/send/sms', {
    mobile: '9876543210',
    length: 6
}, {
    headers: {
        'Authorization': 'Bearer ak_YOUR_API_KEY',
        'Content-Type': 'application/json'
    }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));

Error Codes

HTTP Code Message ID / Error Code Description
401 INVALID_API_KEY Bearer key is invalid or has been disabled by the owner.
402 INSUFFICIENT_BALANCE Your wallet account has insufficient funds. Transaction aborted.
422 VALIDATION_FAILED Request parameters are invalid (e.g. mobile doesn't match Indian format).
429 RATE_LIMIT_EXCEEDED Too many requests per minute/day. Throttling applied.