Skip to main content

Zero-tap authentication templates

Updated: Dec 4, 2025 Zero-tap authentication templates allow your users to receive one-time passwords or codes via WhatsApp without having to leave your app. When a user in your app requests a password or code and you deliver it using a zero-tap authentication template, the WhatsApp client simply broadcasts the included password or code and your app can capture it immediately with a broadcast receiver. From your user’s perspective, they request a password or code in your app and it appears in your app automatically. If your app user happens to check the message in the WhatsApp client, they will only see a message displaying the default fixed text: < code > is your verification code. Like one-tap autofill button authentication templates, when the WhatsApp client receives the template message containing the user’s password or code, we perform a series of eligibility checks. If the message fails this check and we are unable to broadcast the password or code, the message will display either a one-tap autofill button or a copy code button. For this reason, when you create a zero-tap authentication template, you must include a one-tap autofill and copy code button in your post body payload, even if the user may never see one of these buttons. Note: The OTP Android SDK is in beta and features a simplified workflow for implementing one-tap and zero-tap authentication templates. You can learn how to use it below.

Limitations

Zero-tap is only supported on Android. If you send a zero-tap authentication template to a WhatsApp user who is using a non-Android device, the WhatsApp client will display a copy code button instead. URLs, media, and emojis are not supported.

Best practices

Do not make WhatsApp your default password/code delivery method. Make it clear to your app users that the password or code will be automatically delivered to your app when they select WhatsApp for delivery. Link to our About security codes that automatically fill on WhatsApp help center article if your users are worried about auto-delivery of the password or code. After the password/code is used in your app, make it clear to your app user that it was received successfully. Here are some examples that make it clear to an app user that their code will automatically appear in the app.

Creating authentication templates

Use the WhatsApp Business Account > Message Templates endpoint to create a zero-tap authentication template.

Request Syntax

Note that in your template creation request the button type is designated as otp, but upon creation the button type will be set to url. You can confirm this by performing a GET request on a newly created authentication template and analyzing its components.

Request parameters

Example request

Example response

App signing key hash

You must include your app signing key hash in your post body. To calculate your hash, follow Google’s instructions for computing your app’s hash string. Alternatively, if you follow Google’s instructions and download your app signing key certificate (step 1), you can use your certificate with the sms_retriever_hash_v9.sh shell script to compute the hash. For example:

Supported apps

The supported_apps array allows you define pairs of app package names and signing key hashes for up to 5 apps. This can be useful if you have different app builds and want each of them to be able to initiate the handshake:
Alternatively, if you are using Graph API version 20.0 or older and have only a single app, you can define the app’s package name and signing key hash as buttons object properties, but this is not recommended as we will stop supporting this method starting with version 21.0:

Handshake

You must signal to the WhatsApp client to expect imminent delivery of a password or code. You can do this by initiating a “handshake”. A handshake is an Android intent and public class that you implement but that the WhatsApp client can start. When a user in your app requests a password or code to be delivered to their WhatsApp number, first initiate the handshake, then call our API to send the authentication template message. When the WhatsApp client receives the message, it will perform an eligibility check, and if there are no errors, start a broadcast. If you do not initiate the handshake before sending the message, or the message fails an eligibility check, the broadcast will not be started. Instead, the delivered message will display a one-tap autofill button, if able to do so. If unable to do so, it will display a copy code button.

Eligibility Check

The WhatsApp client performs the following checks when it receives an authentication template message. If any check fails, it will attempt to display the one-tap autofill button in the message. If unable to do so, it will fall back to a copy code button. The handshake was initiated no more than 10 minutes ago (or no more than the number of minutes indicated by the template’s code_expiration_minutes property, if present). The package name in the message (defined in the package_name property in the components array upon template creation) matches the package name set on the intent. The match is determined through the getCreatorPackage method called in the PendingIntent object provided by your application. See One-Tap Autofill Button Class. The app signing key hash in the message (defined in the signature_hash property in the components array upon template creation) matches your installed app’s signing key hash. Your app has defined a one-tap autofill button activity and class to receive the password or code. Your app has defined a zero-tap broadcast receiver and class to receive the password or code.

Android notifications

Android notifications indicating receipt of a WhatsApp authentication template message will only appear on the user’s Android device if: The user is logged into the WhatsApp app or WhatsApp Business app with the phone number (account) that the message was sent to. The user is logged into your app. Android OS is KitKat (4.4, API 19) or above. Show notifications is enabled ( Settings > Notifications) in the WhatsApp app or WhatsApp Business app. Device level notification is enabled for the WhatsApp app or WhatsApp Business app. Prior message threads in the WhatsApp app or WhatsApp Business app between the user and your business are not muted.

Using the SDK (Beta)

The OTP Android SDK is available in beta. It can be used to perform handshakes, as well as other functions in both one-tap and zero-tap authentication templates. To access SDK functionality, add the following configuration to your Gradle file:
To your repositories, add mavenCentral():

Zero-tap broadcast receiver

Declare a Receiver and intent filter that can receive the one-time password or code. The intent filter must have the action name com.whatsapp.otp.OTP_RETRIEVED.
This is the receiver that the WhatsApp app or WhatsApp Business app will start once the authentication template message is received and it passes all eligibility checks.

Zero-tap receiver class

Using the SDK (Preferred) Define a class that extends BroadcastReceiver, then define the onReceive method, passing in your context and intent. Instantiate a WhatsAppOtpIncomingIntentHandler object, then run the .processOtpCode() method which will receive the intent, validate the OTP code, and handle errors.

Without the SDK

The broadcast receiver class should look something like this:

One-tap autofill button activity (optional)

If you want the delivered message to be able to fall back to a one-tap autofill button if the message fails the eligibility check, implement this activity and intent filter in your app to receive the one-time password or code. The intent filter must have the action name com.whatsapp.otp.OTP_RETRIEVED.
This is the activity that the WhatsApp client will start if the message fails the eligibility check but is still eligible to display a one-tap autofill button.

One-tap autofill button activity class (optional)

If you want the message to be able to display a one-tap autofill button if the if fails an eligibility check, define the activity public class that can accept the code once the user taps the button.

Initiating the handshake

Using the SDK (Preferred)

Performing a handshake can be done by instantiating a WhatsAppOtpHandler object and passing in your context to the .sendOtpIntentToWhatsApp() method:

Without the SDK

This example demonstrates one way to initiate a handshake with the WhatsApp app or WhatsApp Business app.

Checking if WhatsApp is installed

You can check WhatsApp installation before offering WhatsApp as an option if you expect both WhatsApp and your app to be on the same device. First, you need to add the following to your AndroidManifest.xml file:
Instantiate the WhatsAppOtpHandler object:
Check if the WhatsApp client is installed by passing the .isWhatsAppInstalled() method as the clause in an If statement:

Error signals

See Error Signals that can help with debugging.

Sending authentication templates

Note that you must first initiate a handshake between your app and the WhatsApp client. See Handshake above.

Request

Use the WhatsApp Business Phone Number > Messages endpoint to send an authentication template message with a one-time password button.

Request syntax

Request parameters

Response

Upon success, the API will respond with:

Response Parameters

Example Request

Example Response

Did you find this page helpful? Thumbs up icon Thumbs down icon ON THIS PAGE Limitations Best practices Creating authentication templates Request Syntax Request parameters Example request Example response App signing key hash Supported apps Handshake Eligibility Check Android notifications Using the SDK (Beta) Zero-tap broadcast receiver Zero-tap receiver class Without the SDK One-tap autofill button activity (optional) One-tap autofill button activity class (optional) Initiating the handshake Using the SDK (Preferred) Without the SDK Checking if WhatsApp is installed Error signals Sending authentication templates Request Request syntax Request parameters Response Response Parameters Example Request Example Response