← Back to Blog

How to Send WhatsApp OTPs in Node.js Without Meta Approval (2026 Guide)

By 5MinutesAPI Engineering

The Problem with Traditional WhatsApp Integration

If you are a developer trying to secure your SaaS or mobile app with WhatsApp OTPs, you already know the nightmare. The official Meta Cloud API requires a Verified Facebook Business Manager, manual template approvals, and a complex embedded signup flow. This process can take anywhere from 3 to 14 days. Startups don't have weeks to wait. You need an API key right now to test your authentication flows and go to production.

The Solution: 5 Minutes to Production

We built the Instant API Gateway at 5MinutesAPI specifically for this use case. You do not need to verify a business account. You simply top up $10 into your prepaid wallet, and our engine generates a master API key instantly. You can start hitting our endpoints and delivering OTPs to 244 countries immediately.

Step-by-Step Node.js Implementation

Here is how you can implement WhatsApp OTPs in your Node.js backend using the native fetch API.

1. Get Your Instant API Key

Sign up on 5MinutesAPI, navigate to the Dashboard, and click Generate API Key. Copy your 5m_live_xxx key.

2. The Node.js Code Snippet



const sendWhatsAppOTP = async (phoneNumber, otpCode) => {
try {
const response = await fetch("https://api.5minutesapi.com/v1/send-otp", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_MASTER_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
to: phoneNumber, // e.g., "971501234567"
code: otpCode    // e.g., "492011"
})
});

const data = await response.json();
return data;


} catch (error) {
console.error("OTP Delivery Failed:", error);
}
};

Handling Invalid Numbers & Auto-Refunds

One of the biggest issues with standard SMS gateways like Twilio or MessageBird is that you pay for the message even if the phone number is invalid. 5MinutesAPI fixes this using Meta's webhook system.

If you trigger an OTP to a number that does not have WhatsApp installed, our Golang engine instantly detects the delivery failure and automatically refunds the exact cost back to your wallet in milliseconds. You only pay for successful deliveries.

Ready to upgrade your infrastructure?

Start Building with 5MinutesAPI