WhatsApp authentication templates for OTP: how they work and what they cost
Written and reviewed by the DiOTP team Published 30 November 2026Last updated 30 November 2026
7 min read
A WhatsApp authentication template is the only kind of message Meta allows a business to use for sending one-time passwords on the WhatsApp Business Platform. Unlike an SMS, where you write and register your own wording, a WhatsApp OTP template follows a fixed format set by Meta, with a small set of options and buttons. This guide explains what the format contains, which buttons are available on which phones, what is not allowed, how pricing works, and how DiOTP lets you send codes on WhatsApp through the same API you use for SMS.
What an authentication template is
WhatsApp lets businesses start a conversation with a customer only through pre-approved message templates. Meta sorts these templates into three categories: marketing, utility and authentication. Meta describes authentication templates as template messages for identity verification. In practice that means one-time passwords and verification codes for sign-up, login, account recovery and confirming sensitive actions.
The category matters for two reasons. It decides what the message is allowed to contain, and it decides the price Meta charges for each message. A code sent in a marketing or utility template is not the correct use of those categories, so any business sending codes on WhatsApp needs an authentication template approved on its WhatsApp Business account.
The details in this guide are taken from Meta's developer documentation on authentication templates and pricing, checked on 30 November 2026: developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates and developers.facebook.com/docs/whatsapp/pricing. Meta updates these pages, so check them for the latest rules.
The fixed body text
With most templates, the business writes its own body. A Meta WhatsApp authentication template is different: the text is preset and cannot be customised. The body reads "{{code}} is your verification code.", where the code is filled in at send time.
Two optional lines can be added beneath it:
- A security disclaimer: "For your security, do not share this code."
- An expiry warning: "This code expires in <number> minutes.", where the number can be set from 1 to 90.
That is the whole message. You cannot add your own sentences, offers or instructions. For a customer, this consistency is useful: every verification code on WhatsApp looks the same, so an odd-looking message claiming to be a code stands out. The business name and verified profile shown at the top of the chat tell the customer who sent it.
Buttons: copy code, one-tap autofill and zero-tap
An authentication template can carry a button that helps the customer get the code into your app without retyping it. Meta offers three options.
| Button | What it does | Where it works |
|---|---|---|
| Copy code | Copies the code to the clipboard so the customer can paste it into your app or website. | Works on any phone; Meta suggests it for older iPhones. |
| One-tap autofill | The customer taps a button and the code is filled into your Android app. | Android. Meta notes that on iOS 26 and later, keyboard suggestions offer autofill without extra work, and earlier iOS versions do not support it. |
| Zero-tap | The code is passed to your Android app automatically, with no tap needed. | Android only. It needs extra setup in your app. |
One-tap and zero-tap need your Android app to be registered with the template, so they suit businesses that send codes into their own native app. For codes typed into a website, the copy code button is the practical choice. Meta caps the button label at 25 characters if you set one; otherwise WhatsApp shows a default label in the template's language.
What an authentication template cannot contain
Meta's documentation is clear that URLs, media and emojis are not supported in authentication templates. There is no image header, no link to your app and no smiley in the text. The code itself can be up to 15 characters.
- No URLs: you cannot add a link, even to your own website.
- No media: no image, video or document header.
- No emojis anywhere in the message.
- No custom body text: only the preset line and the two optional lines above.
These limits are there to keep codes safe. A link inside a verification message is a classic phishing pattern, and removing that option makes fake code messages easier to spot.
Using a WhatsApp Business API authentication template yourself
If you go directly to the platform, the steps are broadly these: set up a WhatsApp Business account and a business phone number, verify your business with Meta, create a WhatsApp business API authentication template with the options you want, wait for approval, then build the code to send it, generate and store codes, check them, and handle expiry and retries. For one-tap or zero-tap you also add app details and handle the code inside your Android app.
None of that is unusual for a team with time and engineering capacity. But for a business that only wants codes to arrive on WhatsApp, it is a lot of setup before the first message goes out.
How DiOTP sends WhatsApp OTPs
DiOTP removes the template work entirely. We send on an authentication template that DiOTP already has approved, from a WhatsApp business sender that DiOTP provides. You do not write a template, submit it to Meta, or wait for review. Codes arrive from our sender, not from your own WhatsApp number.
You use the same API as for SMS. Set channel to "whatsapp" on the send request and DiOTP generates the code, sends it, stores it and checks it when your user types it in. Your server never sees the code. Codes expire after 5 minutes, allow 5 attempts and can be verified only once, exactly as with SMS. WhatsApp is switched on for each account by our team; until it is, a WhatsApp send returns 409 channel_not_enabled. Read more on our WhatsApp OTP page and in the API docs.
curl -X POST https://api-diotp.diorbit.com/v1/otp/send \ -H "Authorization: Bearer $DIOTP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 5f2b8c1e-login-9876543210" \ -d '{ "to": "9876543210", "country_code": 91, "channel": "whatsapp", "purpose": "login" }'
const res = await fetch("https://api-diotp.diorbit.com/v1/otp/send", { method: "POST", headers: { Authorization: `Bearer ${process.env.DIOTP_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID(), }, body: JSON.stringify({ to: "9876543210", country_code: 91, channel: "whatsapp", purpose: "login", }), }); const otp = await res.json(); // Keep otp.request_id: you need it to verify.
import os, uuid, requests res = requests.post( "https://api-diotp.diorbit.com/v1/otp/send", headers={ "Authorization": f"Bearer {os.environ['DIOTP_API_KEY']}", "Idempotency-Key": str(uuid.uuid4()), }, json={ "to": "9876543210", "country_code": 91, "channel": "whatsapp", "purpose": "login", }, timeout=10, ) otp = res.json() # Keep otp["request_id"]: you need it to verify.
<?php $ch = curl_init("https://api-diotp.diorbit.com/v1/otp/send"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("DIOTP_API_KEY"), "Content-Type: application/json", "Idempotency-Key: " . bin2hex(random_bytes(16)), ], CURLOPT_POSTFIELDS => json_encode([ "to" => "9876543210", "country_code" => 91, "channel" => "whatsapp", "purpose" => "login", ]), ]); $otp = json_decode(curl_exec($ch), true); // Keep $otp["request_id"]: you need it to verify.
Keep your API key on your server, in an environment variable such as DIOTP_API_KEY. Anyone holding the key can send codes on your account, so it must never be placed in a mobile app or browser code.
WhatsApp authentication template pricing
Meta charges for WhatsApp business messages on a per-message basis, effective 1 July 2025, replacing the earlier conversation-based model. The rate for each message depends on two things: the template category, and the market, which is the country calling code of the person receiving it. Authentication is priced as its own category.
Meta's pricing page also lists an authentication-international rate for certain markets, India among them. Meta decides which businesses that rate applies to under eligibility rules it sets out on its own pages, and it lists a change to India's rate effective 1 April 2026. Meta publishes its rate cards, including rupee list rates, as downloadable files linked from that page, and they change from time to time.
With DiOTP, you do not need to track Meta's rate card. WhatsApp OTP is priced per account and quoted by our team, rather than published. SMS OTP prices are listed on our pricing page, and you can ask for a WhatsApp quote from the same place. Verifying a code is free on every channel.
WhatsApp or SMS for OTPs?
WhatsApp suits users who live in the app and is especially handy where a copy or autofill button saves typing. SMS reaches every mobile number, including basic phones and users without WhatsApp. Many teams offer WhatsApp first with SMS as a fallback, or let the user choose. Because DiOTP uses one API for both, switching channel is a one-field change, and the verify call is identical.
