Drawing 1 · Interactive
Compare the three OTP button types
| Where it works | User effort | App setup | If conditions fail | |
|---|---|---|---|---|
| COPY_CODE | ||||
| ONE_TAP | ||||
| ZERO_TAP |
Hover, tap or arrow-key through the cells — a dot in the corner means there is a note.
ZERO_TAP by Where it works
Android onlyNeeds app work
Same device and app requirements as one-tap.
Legend — press one to highlight its cells
Row 3 of 3. ZERO_TAP × Where it works: Android only. Same device and app requirements as one-tap.
What is an authentication template?
An authentication template is a message template in the AUTHENTICATION category, built for one job: delivering a one-time passcode (OTP) or verification code to your own users for login, sign-up, payment confirmation or account recovery. Unlike marketing and utility templates, you do not write the body. Meta supplies preset, localised text: "<code> is your verification code.", an optional security line ("For your security, do not share this code.") switched on with add_security_recommendation, and an optional footer ("This code expires in N minutes.") set with code_expiration_minutes between 1 and 90.
What you choose is how the code reaches the user. Every authentication template carries one OTP button configuration, set with otp_type: COPY_CODE (the user taps a button that copies the code, then pastes it), ONE_TAP (an Android Autofill button hands the code to your app) or ZERO_TAP (no button at all, because your Android app receives the code automatically). One-tap and zero-tap need supported_apps entries with your app's package_name and signature_hash, plus a handshake from your app before each send; when those conditions fail, WhatsApp shows a copy-code button instead.
The content rules are strict by design. The code itself is the only variable, it can be at most 15 characters, and URLs, media and emojis are not supported. That fixed shape makes OTP messages look the same across every business, which helps users recognise genuine codes and makes spoofing harder. It is also why authentication has its own price: in India each delivered authentication message is charged at ₹0.14, and a separate, higher authentication-international rate applies when a business registered in another country sends OTPs to Indian numbers (see /pricing).
Key takeaways
- An authentication template is the WhatsApp template category built only for one-time passcodes, with body text supplied by Meta.
- You choose the button: COPY_CODE works on every phone; ONE_TAP and ZERO_TAP need an Android app and fall back to copy code.
- The OTP is the only variable: up to 15 characters, sent twice, in the body parameter and in the button parameter.
- Match
message_send_ttl_secondsto the code's validity: the default time-to-live is 10 minutes, adjustable from 30 seconds to 15 minutes. - In India each delivered authentication message costs ₹0.14; OTPs from businesses registered abroad pay a higher international rate.
How does InfiQ help with an authentication template?
Create authentication templates in InfiQ's template manager and send OTPs through InfiQ's API with the same body Meta's Cloud API takes, with delivery reported per message.
InfiQ API referenceSpecifications
An authentication template: key facts and limits
- Body text
- Preset by Meta, localised, not editable
- Button types
- COPY_CODE, ONE_TAP, ZERO_TAP
- Code length
- Up to 15 characters
- Expiry footer
- code_expiration_minutes 1–90
- Time-to-live
- Default 10 min, 30 s to 15 min
- Not allowed
- URLs, media and emojis
- India rate
- ₹0.14 per delivered message
Operating sequence
How does an authentication template work?
Pick the button type
Start with
COPY_CODE, which works on every primary phone. AddONE_TAPorZERO_TAPonly when you control an Android app and can register its package name and signing-key hash.Create the template
POST to
/{WABA_ID}/message_templateswithcategory: AUTHENTICATION, a BODY withadd_security_recommendation, an optional FOOTER withcode_expiration_minutesand a BUTTONS component oftype: OTP. To create one name in several languages at once, theupsert_message_templatesedge accepts alanguagesarray.Set a short time-to-live
Authentication messages default to a 10-minute time-to-live, adjustable from 30 seconds to 15 minutes with
message_send_ttl_seconds. Match it to your code's validity so an expired code is never delivered late.Handshake on Android (one-tap and zero-tap)
Before each send your app tells WhatsApp it expects a code. The handshake must be no older than 10 minutes, or than
code_expiration_minutesif set, otherwise the message falls back to a copy-code button.Send the code
Call
/{PHONE_NUMBER_ID}/messageswith the template name and the OTP twice: once as the body parameter and once as the button parameter. WhatsApp stores the OTP button as a URL button, so the button component usessub_type: urlandindex: 0.Track and verify
Watch the status webhooks for
deliveredandread, verify the code your user enters server-side, and offer an SMS or voice fallback when a message is not delivered within your timeout.
Implementation
An authentication template in code
curl -X POST "https://api.infiq.in/v1/messages" \-H "X-INFIQ-API-KEY: {INFIQ_API_KEY}" \-H "Content-Type: application/json" \-d '{"messaging_product": "whatsapp","to": "919812345678","type": "template","template": {"name": "login_otp","language": { "code": "en_US" },"components": [{ "type": "body","parameters": [ { "type": "text", "text": "482913" } ] },{ "type": "button", "sub_type": "url", "index": "0","parameters": [ { "type": "text", "text": "482913" } ] }]}}'
The same OTP appears twice: in the body and in the button parameter.
Failure modes
Common mistakes with an authentication template
Trying to customise the wording
Adding a brand line, a link or a promo to an OTP gets the template rejected. Put branding in your display name and profile, and keep the template to the preset text and toggles.
Sending OTPs from a utility or marketing template
Verification codes belong in the authentication category, which is priced and formatted for them. The rule runs both ways: a template wrongly filed as authentication is rejected with no appeal, so keep codes and only codes in this category.
Building only one-tap or zero-tap
Both are Android-only and depend on a fresh handshake. iPhone users, handshake timeouts and signature mismatches all land on the copy-code button, so test that path as carefully as the automatic one.
Leaving the default time-to-live
If your code is valid for 5 minutes but the message can still be delivered later, users receive dead codes. Set
message_send_ttl_secondsto match the code's validity.Assuming linked devices show the code
On the Cloud API, authentication messages sent to linked devices such as WhatsApp desktop are masked with a prompt to view them on the primary phone. Tell users the code arrives on the phone that holds their WhatsApp account.
Design intent
Why does an authentication template matter?
OTP delivery sits on the critical path of sign-ups, logins and payments: a code that arrives late or gets lost costs a conversion, and a code delivered in a spoofable format costs trust. Authentication templates give developers a standard, quickly reviewed format with device-level autofill on Android, a clear expiry footer, delivery receipts and a price set specifically for verification traffic, which is why many Indian apps now offer WhatsApp alongside or ahead of SMS OTP.
Example: Login codes for a Pune lending app
A Pune-based lending app sends login OTPs from an AUTHENTICATION template with the security recommendation on, a 5-minute expiry footer and a matching 300-second time-to-live. Android users who installed the app get a one-tap Autofill button because the app performs the handshake just before requesting the code; iPhone users and anyone whose handshake has lapsed see the copy-code button. If no delivered status arrives within 20 seconds, the backend offers "Send by SMS instead", and every delivered code is billed at the authentication rate.
Recommended practice
Best practices for an authentication template
- Confirm the user's WhatsApp number before sending, and say on screen that the code is going to WhatsApp.
- Use one template name with several languages and pick the language from the user's app locale at send time.
- Show a visible timer in your app that matches
code_expiration_minutes, so the footer and the UI agree. - Offer the SMS or voice fallback only after a timeout with no
deliveredstatus, so users are not sent two live codes at once. - Rate-limit OTP requests per number and per device to block artificially inflated traffic.
Authentication Template FAQs
Can I write my own text for a WhatsApp OTP message?+
Which authentication button type should I use?+
Why does the send request use a URL button for an OTP?+
How much does a WhatsApp authentication message cost in India?+
Is an authentication template the same as the WhatsApp two-step verification PIN?+
* Per-message rates for India, ex-GST: marketing, utility and authentication effective 1 July 2026; service messages ₹0.145 since 1 October 2026 after the first 1,000 a month on each WhatsApp number, which are free (all were ₹0 until 30 September 2026). Volume commitments earn discounts — final rate is confirmed on your account; applicable GST extra. Rates for other countries differ (see the international rate table on /pricing).