~5 minutes to first message

API Quickstart

This guide walks you through sending your first WhatsApp OTP in 5 minutes. You will get your API key, make two API calls, and see a real WhatsApp message on your phone.

1

Get your API key

  1. 1. Sign up for EmacronAI CRM (free, no credit card)
  2. 2. Go to Settings → API Keys
  3. 3. Click Create API Key and copy it
Keep your API key secret. Never commit it to source code. Use environment variables.
2

Install the SDK (optional)

If using Node.js, install the official SDK. Otherwise skip to step 3 and use cURL or fetch directly.

npm install @emacrontechnologies/outreachagent
3

Send your first OTP

Replace YOUR_API_KEY and YOUR_PHONE with your values.

Node.js

import { createClient } from '@emacrontechnologies/outreachagent';

const oa = createClient('YOUR_API_KEY');

const { request_id } = await oa.sendOtp({
  phone: '+919876543210',   // E.164 format with country code
  expiry: 300,              // 5 minutes
  length: 6,
});

console.log('OTP sent! request_id:', request_id);

cURL

curl -X POST https://api.crm.emacronai.com/v1/otp/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+919876543210", "expiry": 300}'

Expected response

{
  "request_id": "otp_abc123xyz",
  "expires_at": "2026-09-01T10:15:00Z"
}
4

Verify the OTP

After the user enters the OTP, call /otp/verify with the request_id from step 3.

// Node.js SDK
const { verified } = await oa.verifyOtp(request_id, userEnteredOtp);

if (verified) {
  // ✅ Phone number confirmed — log the user in
} else {
  // ❌ Wrong OTP — show error to user
}

What to explore next