Overview
The OTP API has two calls: send a code to a mobile number, and verify the code the person types. Every call uses
your secret API key. Base URL: https://api.iindus.in/v1/otp
- Codes are 6 digits, valid for 5 minutes, and work once.
- The number must belong to an TOVII account.
- The code arrives in the TOVII app from the official, read-only TOVII Verify account, showing your app’s name.
How it works
/send. We deliver the code to their TOVII app./verify. If verified is true, log them in.Get an API key
API keys are issued by the TOVII team. Write to contact@iindus.in with your app name,
website and expected daily logins. You’ll receive a key like iik_3fa91c0d2e_…. It is shown only once – store it as a
server secret (for example the environment variable IINDUS_API_KEY).
1. Send a code
POST https://api.iindus.in/v1/otp/send with header X-Api-Key (or Authorization: Bearer …).
| Field | Type | Description |
|---|---|---|
phone | string | 10-digit Indian mobile number (9876543210) or international (+919876543210) |
curl -X POST https://api.iindus.in/v1/otp/send \
-H "X-Api-Key: $IINDUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone": "9876543210"}'
Response 200:
{
"requestId": "1f0c2b7e-5d1a-4c55-9a51-0b8f3c1e9d2a",
"sentTo": "+91••••••3210",
"expiresIn": 300
}
Keep requestId on your server (for example in the session); you need it to verify.
2. Check the code
POST https://api.iindus.in/v1/otp/verify
| Field | Type | Description |
|---|---|---|
requestId | string | From the send response |
code | string | The 6 digits the person typed |
curl -X POST https://api.iindus.in/v1/otp/verify \
-H "X-Api-Key: $IINDUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"requestId": "1f0c2b7e-…", "code": "123456"}'
Right code:
{ "verified": true, "phone": "+919876543210", "name": "Priya Sharma" }
Wrong code:
{ "verified": false, "error": "wrong_code", "attemptsLeft": 4 }
Examples
// server.js (Node 18+). Keep the key on your server – never in the browser.
const IINDUS = 'https://api.iindus.in/v1/otp';
const headers = { 'X-Api-Key': process.env.IINDUS_API_KEY, 'Content-Type': 'application/json' };
// POST /login/start { phone }
app.post('/login/start', async (req, res) => {
const r = await fetch(IINDUS + '/send', { method: 'POST', headers, body: JSON.stringify({ phone: req.body.phone }) });
const data = await r.json();
if (!r.ok) return res.status(r.status).json(data); // e.g. not_on_iindus
req.session.otpRequest = data.requestId; // remember it server-side
res.json({ sentTo: data.sentTo });
});
// POST /login/verify { code }
app.post('/login/verify', async (req, res) => {
const r = await fetch(IINDUS + '/verify', {
method: 'POST', headers, body: JSON.stringify({ requestId: req.session.otpRequest, code: req.body.code }),
});
const data = await r.json();
if (!data.verified) return res.status(400).json(data);
req.session.user = await findOrCreateUserByPhone(data.phone, data.name);
res.json({ ok: true });
});<?php
// Keep the key on your server.
function iindus($path, $body) {
$ch = curl_init('https://api.iindus.in/v1/otp/' . $path);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-Api-Key: ' . getenv('IINDUS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($body),
]);
$out = json_decode(curl_exec($ch), true);
curl_close($ch);
return $out;
}
// Step 1: send
$r = iindus('send', ['phone' => $_POST['phone']]);
$_SESSION['otp_request'] = $r['requestId'] ?? null;
// Step 2: verify
$r = iindus('verify', ['requestId' => $_SESSION['otp_request'], 'code' => $_POST['code']]);
if (!empty($r['verified'])) { /* log in $r['phone'] */ }import os, requests
API = "https://api.iindus.in/v1/otp"
HEADERS = {"X-Api-Key": os.environ["IINDUS_API_KEY"]}
def send_code(phone):
r = requests.post(f"{API}/send", json={"phone": phone}, headers=HEADERS, timeout=10)
r.raise_for_status()
return r.json()["requestId"]
def check_code(request_id, code):
r = requests.post(f"{API}/verify", json={"requestId": request_id, "code": code}, headers=HEADERS, timeout=10)
data = r.json()
return data if data.get("verified") else NoneLogin button
Use this button on your sign-in page. It should lead to your own page that asks for the mobile number and code.
<button class="iindus-login" type="button" onclick="location.href='/login/iindus'">
<img src="https://iindus.in/assets/mark-96.png" alt="" width="44" height="20">
Login with TOVII
</button>
<style>
.iindus-login { display:inline-flex; align-items:center; gap:10px; background:#2e3a59; color:#fff;
border:0; border-radius:12px; padding:12px 18px; font:600 16px system-ui,sans-serif; cursor:pointer }
.iindus-login img { width:24px; height:24px; background:#fdf9f6; border-radius:6px; padding:2px }
</style>
Errors & limits
| Status | error | Meaning |
|---|---|---|
| 401 | – | Missing or wrong API key |
| 403 | – | Key has been turned off |
| 400 | invalid_phone | The number isn’t valid |
| 404 | not_on_iindus | No TOVII account for this number – offer another login method |
| 429 | too_many_codes | More than 5 codes to one number in 15 minutes |
| 429 | daily_limit | Your key’s daily limit is reached |
| 200 | wrong_code | Wrong code; attemptsLeft tells how many tries remain (5 in total) |
| 200 | expired | More than 5 minutes passed – send a new code |
| 200 | already_used / too_many_attempts | Send a new code |
Security tips
- Call the API only from your server. Never put the key in an app, web page or public repository.
- Store
requestIdserver-side and tie it to the visitor’s session. - Add your own rate limit per visitor and per IP for the “send code” button.
- If a key leaks, ask the TOVII team to replace it – the old key stops working immediately.
FAQ
Does the person need the TOVII app?
Yes. The code is delivered inside the TOVII app, so the mobile number must have an TOVII account. If not, send returns not_on_iindus and you can offer another way to log in.
Do you send an SMS?
No. Codes arrive in the app from the official “TOVII Verify” account, with a notification. There is no SMS cost and no SIM delay.
What do I get after a successful check?
The verified mobile number (E.164, e.g. +919876543210) and the person’s TOVII display name.
Is it free?
Ask the TOVII team about plans and daily limits when you request your key.