Sign inGet Started

Authoring WhatsApp authentication templates

Create an authentication template to deliver a one-time passcode for sign-in, account verification, or recovery. Meta supplies the message wording and button labels. You choose how the code is delivered and whether to include Meta's security recommendation and code-expiration notice.

Before you start

Connect your own number and WhatsApp Business Account. Check the account's business verification status before creating or duplicating an authentication template.

Choose how recipients receive the passcode:

  • Copy code adds a clipboard button that works on iOS and Android with no app setup.
  • One-tap autofill and Zero-tap autofill pass the code to your Android app, up to five configured apps per template. Before authoring either option, gather each app's Android package name and 11-character signing key hash and implement Meta's handshake and receive intent in the app. See Meta's one-tap autofill and zero-tap guides. Meta is deprecating the PendingIntent handshake on January 31, 2027, in favor of its OTP Android SDK. For zero-tap, register the one-tap autofill activity alongside your zero-tap broadcast receiver so WhatsApp can fall back to a tap when zero-tap cannot complete.

Creating the template

  1. Open Approved templates, select New template, then Start from scratch.
  2. Choose Authentication and the connected business account. Enter a name and choose the default language.
  3. Select Create template to open the editor.

To start from an existing template, choose Start with a template and copy an authentication template onto your account. The copy opens as a draft that requires separate submission. Imported authentication templates can fail duplication with E15024. In that case, create a new template from scratch.

Configuring the message

The Authentication settings panel replaces the free-text editor:

  1. Enable Add security recommendation to include Meta's advice against sharing the code.
  2. Set Code expiry notice (1 to 90 minutes or Don't show). Match it to the code validity your application enforces. The notice does not expire a code in your application.
  3. Select Copy code, One-tap autofill, or Zero-tap autofill in Code delivery, then complete any app and consent fields shown below it.
  4. Set Time to live (30 seconds to 15 minutes, or Default · 10 min) to no more than the code's validity so WhatsApp drops a message it could not deliver before the code expired.
  5. Check the phone preview, then select Save as draft.

The authentication template editor showing the security recommendation toggle, code-expiration field, and a phone preview with a Copy code button

Authentication content cannot include URLs, media, or emojis. A passcode can contain at most 15 characters. See Meta's authentication template overview and copy-code template guide.

Choosing code delivery

Code delivery controls how WhatsApp presents the passcode:

  • Copy code (copy_code, default): shows a button that copies the code to the clipboard.
  • One-tap autofill (one_tap): shows an autofill button on Android that opens your app and passes it the code.
  • Zero-tap autofill (zero_tap): delivers the code to your Android app by broadcast without the recipient leaving your app or tapping a button in WhatsApp.

When you select One-tap autofill or Zero-tap autofill, configure one to five apps under Android apps. Use Add app to add builds signed with different keys, such as Play App Signing and a debug keystore, or the trash button to remove an app:

  • Package name: your Android application ID, such as com.example.app. Use at least two dot-separated segments starting with a letter, up to 224 characters.
  • Signature hash: the 11-character base64 signing key hash for that build, such as K8a/AINcGX7. Compute it from the certificate that signs the installed app. See Compute the app hash.

You can save an unfinished draft and complete the app fields before selecting Submit for review.

When you select Zero-tap autofill, follow Read Meta’s zero-tap terms (Meta's zero-tap terms) and check I accept the zero-tap terms and will tell users their code fills in automatically. Submission requires this box to be checked. Your app's verification screen must also tell users that their code fills in automatically.

Because WhatsApp supplies and translates the button label for each language, there is no button-label input. The phone preview shows Meta's localized Copy code label for Copy code and Meta's localized autofill label (such as Autofill in English) for One-tap autofill and Zero-tap autofill. On iOS, or on Android when no app handshake is active or zero-tap falls back, WhatsApp displays Copy code or the one-tap autofill button without reporting an error.

Managing multiple languages

Add the languages your application needs and check the preview for each language. Approval comes back per language.

Add security recommendation, Code expiry notice, and Time to live are configured per language. Code delivery, Android apps, and zero-tap terms apply across the template's languages:

  • Adding a language in the editor copies the code delivery settings from an existing draft language, starting from the default language.
  • Changing Code delivery, Android apps, or the zero-tap terms checkbox updates the other saved languages in the draft while keeping each language's security recommendation, code expiry notice, and Time to live.
  • Wait for any language under review to finish before changing its code delivery.
  • If draft languages have different code delivery settings, Submit for review blocks submission. Open a language with the settings you want and select Apply to all languages.

Authoring through the API

On PUT /v1/whatsapp/templates/{template_ref}/versions/{version_id}/languages/{language}, send body, optional footer, and a buttons block with one otp button:

Code example
{
  "components": [
    { "type": "body", "add_security_recommendation": true },
    { "type": "footer", "code_expiration_minutes": 10 },
    {
      "type": "buttons",
      "buttons": [
        {
          "type": "otp",
          "otp_type": "zero_tap",
          "supported_apps": [
            {
              "package_name": "com.example.app",
              "signature_hash": "K8a/AINcGX7"
            }
          ],
          "zero_tap_terms_accepted": true
        }
      ]
    }
  ],
  "message_send_ttl_seconds": 600
}

Omit text on the otp button so WhatsApp uses its translated button labels. Custom labels on one_tap and zero_tap are rejected on submit. Include supported_apps (one to five entries) when otp_type is one_tap or zero_tap. Include zero_tap_terms_accepted: true when otp_type is zero_tap. Write matching otp button settings to each language in the draft before submitting the version.

Submitting and testing

  1. Select Submit for review.
  2. Wait for the language to be approved and listed in available_languages.
  3. Open the template's Send tab and select Send test message. You can also select Send test of approved version in the builder's preview panel.

To send through the API, copy the example request from the Send tab. Set from to a number on the template's business account, set to to your test recipient's phone number, and pass the passcode in parameters.code.

Confirm that the message arrives on the recipient's primary WhatsApp device and that your application accepts the code before expiry and rejects it afterward. For one-tap or zero-tap delivery, start Meta's handshake from an Android build signed with a configured signature_hash before sending, then check that your app receives the code.

If creation fails with E15043, check the connected account's verification status. If submission fails, read the error on the affected language before editing or retrying.

Next steps