Wani API Documentation

The complete developer guide — same journey as Quick Start: CLI, SDK, or REST API

Base URLhttps://your-domain.com/api/developers/otp

🚀 Pick your path — same journey as Quick Start

Three ways to build with Wani. All of them run the same flow: send OTP → user receives it on WhatsApp → enter code → verify.

1 CLI

Fastest way to test and onboard.

terminal
npm install -g @aiwni/cli
wani login
wani project list
wani project use <project>
wani otp test

wani otp test runs the full flow: send → receive → enter code → verify.

2 SDK

To embed Wani inside your project backend (Node.js 18+, server-side only).

terminal
npm install @aiwni/sdk
server.js
import { Wani } from "@aiwni/sdk";

const wani = new Wani({ apiKey: process.env.WANI_API_KEY });

const sent = await wani.otp.send({
  phone: "2010xxxxxxxx",
  templateId: "YOUR_TEMPLATE_ID",
  expiryMinutes: 10,
});

const res = await wani.otp.verify({ token: sent.token, code: "123456" });
const st = await wani.otp.status(sent.token);

3 REST API

For any other language or runtime. Three endpoints:

http
POST /api/developers/otp/send
POST /api/developers/otp/verify
GET  /api/developers/otp/status/:token

Header x-api-key on every call. Full contract in API Reference.