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/send

Send a WhatsApp OTP. Returns a request_id for verification.

Request body

FieldTypeRequiredDescription
phonestringYesE.164 format. Example: +919876543210
expiryintegerNoValidity in seconds. Default: 300. Range: 60–900.
lengthintegerNoOTP digit count. Default: 6. Range: 4–8.
POST/whatsapp/otp/verify

Verify an OTP. Returns verified: true or false.

Request body

FieldTypeRequiredDescription
request_idstringYesThe request_id returned by /whatsapp/otp/send
otpstringYesThe OTP entered by the user

Error codes

HTTPcodeDescription
400VALIDATION_ERRORMissing or invalid field (e.g. phone not in E.164 format)
401UNAUTHORIZEDMissing or invalid API key
422INVALID_OTPOTP does not match or has expired
429RATE_LIMIT_EXCEEDEDToo many OTP requests for this phone number. Wait 1 hour.
500INTERNAL_ERRORServer error. Retry with exponential backoff.

Rate limits

EndpointLimit
POST /whatsapp/otp/send10 per phone per hour
POST /whatsapp/otp/verify5 attempts per request_id
POST /whatsapp/send1000/minute per WABA
POST /whatsapp/broadcasts100 broadcasts/day
GET/POST /contacts100 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

Downloads