WhatsApp OTP API
The EmacronAI CRM OTP API lets you send one-time passwords via WhatsApp and verify them server-side. Cheaper than SMS, higher delivery rate, no DLT registration required.
₹0.14–₹0.45
Cost per OTP
vs ₹0.45–0.68 for SMS
98%+
Delivery rate
vs ~85% for SMS
60–900s
OTP expiry
Configurable per request
Authentication
All requests require a Bearer token. Get your API key from Settings → API Keys in your dashboard.
Authorization: Bearer YOUR_API_KEY
Send & verify OTP
Two API calls: send, then verify.
import { createClient } from '@emacrontechnologies/outreachagent';
// npm install @emacrontechnologies/outreachagent
const oa = createClient(process.env.OUTREACHAGENT_API_KEY);
// 1. Send OTP
const { request_id } = await oa.otp.send({
phone: '+919876543210',
expiry: 300, // seconds
length: 6,
});
// 2. Verify OTP (after user enters it)
const { verified } = await oa.otp.verify(request_id, userEnteredOtp);
if (verified) {
console.log('Phone verified ✅');
} else {
console.log('Invalid OTP ❌');
}Install: npm install @emacrontechnologies/outreachagent
Endpoint reference
POST
/whatsapp/otp/sendSend a WhatsApp OTP. Returns a request_id for verification.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
phone | string | Yes | E.164 format. Example: +919876543210 |
expiry | integer | No | Validity in seconds. Default: 300. Range: 60–900. |
length | integer | No | OTP digit count. Default: 6. Range: 4–8. |
POST
/whatsapp/otp/verifyVerify an OTP. Returns verified: true or false.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | The request_id returned by /whatsapp/otp/send |
otp | string | Yes | The OTP entered by the user |
Error codes
| HTTP | code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Missing or invalid field (e.g. phone not in E.164 format) |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 422 | INVALID_OTP | OTP does not match or has expired |
| 429 | RATE_LIMIT_EXCEEDED | Too many OTP requests for this phone number. Wait 1 hour. |
| 500 | INTERNAL_ERROR | Server error. Retry with exponential backoff. |
Rate limits
| Endpoint | Limit |
|---|---|
| POST /whatsapp/otp/send | 10 per phone per hour |
| POST /whatsapp/otp/verify | 5 attempts per request_id |
| POST /whatsapp/send | 1000/minute per WABA |
| POST /whatsapp/broadcasts | 100 broadcasts/day |
| GET/POST /contacts | 100 req/minute per API key |
Node.js SDK
The official npm package wraps the REST API with full TypeScript types, auto-retry, and clean error handling.
npm install @emacrontechnologies/outreachagent