LogoLogo
Become a PartnerStatus Page
  • get started
    • Welcome to 360Dialog
    • Quickstarts
      • Getting started as a partner
      • Register as a Meta Tech Provider
      • Add a WhatsApp Number
      • Set up Integrated Onboarding
      • Create a Message Template
      • Send a Message
    • Pricing & Billing
      • Payment Methods for BR: Pix & Boleto
      • Month Closing Invoice (MCI)
    • Get API Access
    • Tech Provider Program
      • Understanding the Meta Tech Provider Program
      • Becoming a Meta Tech Provider: A Step-by-Step Guide
  • MM Lite Beta Program
    • Onboarding
    • Sending Messages
    • MM Lite versus Cloud API
    • Expected Errors & Programming Languages
  • Voice Message Alpha Program
  • Partner & Account Management
    • Solutions for Partners
      • Benefits for Partners
      • Partner Hub
      • WABA Management
    • Account Setup & Management
      • Prerequisites and best practices for account creation
      • Account Structure
      • Account Creation
  • Integrations & API Development
    • Webhook Events & Setup
      • Webhook Events (Partner & Messaging API)
      • Webhook Configuration & Management
    • Integration Best Practices
      • Architecture and Security
      • Best Practices for Designing Integrations
        • Design a Stable Webhook Receiving Endpoint
      • Sizing Your Environment Based on Expected Throughput
      • Design a Resilient Message Sending Service
      • Integrated Onboarding
        • Basic Integrated Onboarding
        • Custom Integrated Onboarding
        • Host Your Own Embedded Signup
      • API Key Authentication for the Partner API
  • API Reference
    • Messaging API
    • Messaging Health Status
    • Sandbox (Test API Key)
    • Differences Between Cloud API and On-Premise API for Partners
      • [will be deprecated] Messaging with On-Premise API
    • Partner API
  • WABA Management
    • Managing WABA Accounts
      • Using the Partner Hub to manage Clients and Channels
      • Using the Partner API to manage Clients and Channels
      • Partner Permission to Generate API Key
      • Checking Usage & Statistics
    • Phone Number & Hosting
      • Migrating a Phone Number
        • Migrate number from Meta or alternate BSP to 360Dialog
        • Migrate a phone number to a new WABA
        • Migrate a phone number to a new WABA to change messaging Currency
      • WhatsApp Coexistence
        • Coexistence Onboarding
        • Coexistence Webhooks
        • Testing different messaging scenarios
      • Hosting type Change (On-premise API to Cloud API)
    • WABA Profile & Compliance
      • Display Name Guidelines
      • WABA Profile Info
      • WABA Policy Enforcement
      • Business Account Verification
    • Partner change (between 360Dialog Partners)
    • WhatsApp Flows
    • Accelerated Onboarding
    • Business Account Verification
  • Messaging
    • Sending & Receiving Messages
      • Conversations
      • Receiving messages
      • Before sending a message
    • Message Types
      • Conversational Components
      • Checklist for Message Broadcasts and Campaigns
      • Text messages
      • Interactive messages
        • Single and Multi Product Messages
        • Location Request Messages
        • Address Messages (India and Singapore only)
      • Contacts & Location Messages
    • Template Messages
      • Template Library
      • Template Elements
      • Sending Template Messages
      • Authentication Templates
        • Zero-Tap Authentication Templates
        • One-Tap Autofill Authentication Templates
        • Copy Code Authentication Templates
      • Catalog Templates
      • Product Card Carousel Templates
      • Single-Product Message Templates
      • Coupon Code Templates
      • Limited-Time Offer Templates
      • Multi-Product Templates
    • Media Messages
      • Upload, retrieve or delete media
    • Messaging Health & Troubleshooting
      • Messaging Limits & Quality Rating
      • Errors While Messaging
      • Messages statuses
  • Commerce & Payments
    • Payments (India Only)
      • Receive WhatsApp Payments via Payments Gateway
      • Receive WhatsApp Payments via Payment Links
      • Order Details Template Message
    • Payments (Singapore Only)
      • Receive WhatsApp Payments via Stripe
    • Payments API Brazil
      • Implementation
    • Products and Catalogs
      • India Businesses: Compliance for Commerce
  • Support & Updates
    • Help & Troubleshooting
      • FAQ
      • Error Code Reference
      • User Support Documentation
        • Tutorials
          • Page How to Troubleshoot Login Issues in the 360dialog Hub
          • How to Report an Issue
          • How to Contact Support
        • How-To Guides
          • Raise a Support Request
          • Requesting a Status Update for Business Verification
        • Reference
          • Troubleshooting Embedded Signup Issues
          • Commerce Policy Checks for WhatsApp API Access
          • Support Availability & SLAs
          • Incident Issue Prioritization
          • Case Types Table
        • Explanation
          • Why Business Verification Takes Time
          • Why Some Issues Are Not Emergencies
          • Understanding the Support Process
      • Support with Meta
    • Imprint & Data Privacy
    • Product Updates & News
      • How to ensure your Template Messages will be received
      • Integrated Onboarding new look and Campaigns Best Practices
Powered by GitBook
On this page
  • Authentication Template Requirements
  • Linked Device Security
  • Buttons
  • Time-To-Live
  • Creating Authentication Templates
  • Sending Authentication Templates
  • [will be deprecated] If the WABA is registered in On-Premise API

Was this helpful?

  1. Messaging
  2. Template Messages

Authentication Templates

PreviousSending Template MessagesNextZero-Tap Authentication Templates

Last updated 7 months ago

Was this helpful?

Starting April 1, 2024, any existing authentication template that is not an cannot be sent, edited, or appealed. Authentication templates are available in India since July 1, 2024.

Authentication templates enables businesses to authenticate users with one-time passcodes (usually 4-8 digit alphanumeric codes), potentially at multiple steps in the login process (e.g., account verification, account recovery, integrity challenges).

If your mobile app offers users the option to receive one-time passwords or verification codes via WhatsApp, you must use an authentication template.

It's appropriate to use an authentication template when:

Definition
Examples

Providing an authentication code to the user

  • "{{1}} is your verification code."

  • "{{1}} is your verification code. For your security, do not share this code."

  • "{{1}} is your verification code. This code expires in 15 minutes."

Authentication Template Requirements

Authentication templates include optional add-ons like security disclaimers and expiry warnings. In addition, authentication templates must have a one-time password button (copy code or one-tap).

It consist of:

  • Fixed preset text: <VERIFICATION_CODE> is your verification code.

  • An optional security disclaimer: For your security, do not share this code.

  • An optional expiration warning: This code expires in <NUM_MINUTES> minutes.

  • Either a one-tap autofill button, a copy code button, or no button at all if using zero-tap.

Linked Device Security

This feature is enabled by default by Meta and does not require code changes. It cannot be configured or customized. It is only available on Cloud API.

Authentication templates now feature linked device security. This means that authentication messages are only delivered to a user's primary WhatsApp device.

Authentication messages that are sent to a user's linked devices are masked with a prompt instructing the user to view the message on their primary device.

Buttons

Authentication templates must include either a copy code or one-tap autofill button. Buttons behave differently when tapped by a user:

  • A copy code button copies the one-time password or code to the user's clipboard. The user can then manually switch to your app and paste the password or code into your app's interface.

  • A one-tap autofill button automatically loads and passes your app the one-time password or code.

HandShake and App Signing Hash

Authentication Templates requires changes to your application in order to perform a "handshake" with Meta, and your app's signing key hash.

Time-To-Live

If Meta is unable to deliver a message to a WhatsApp user, they will continue attempting to deliver the message for a period of time known as a time-to-live.

If Meta is unable to deliver an authentication template for an amount of time that exceeds its time-to-live, they will stop retrying and drop the message. If the time between your authentication template message send request exceeds the time-to-live and you receive no webhook, assume it was dropped.

To override the default time-to-live when creating an authentication template, include the message_send_ttl_seconds property with a value set between 60 and 600 seconds.

Best Practices for Authentication Templates

  • Confirm the user's WhatsApp phone number before sending the one-time password or code to that number.

  • When the user pastes the password or code into your app, or your app receives it as part of the one-tap autofill button flow, make it clear to the user that your app has captured it.

Creating Authentication Templates

You can use the Partner API to create authentication templates. Alternatively, you can also create it using the 360dialog Hub.

In the API

Use the create template endpoint and assemble the authentication components in the request:

The base-url should be https://waba-v2.360dialog.io for Cloud API and https://waba.360dialog.io for On-Premise.

As announced in November 2023, Meta is transitioning to a fully Cloud-hosted WhatsApp Business Platform and will stop supporting On-Premise API in October 2025. Starting from On-Premise client v2.53, all new feature updates will be exclusively delivered to Cloud API. While the On-Premise API client will receive quarterly releases, they will focus solely on bug fixes and security patches.

POST https://waba-v2.360dialog.io/v1/configs/templates

The message template name field is limited to 512 characters. The message template content field is limited to 1024 characters.

Headers

Name
Type
Description

D360-API-KEY

string

Request Body

Name
Type
Description

name*

string

components*

array[objects]

Array of objects that describe the components that make up the template.

category*

string

Allowed values: AUTHENTICATION

language*

string

Upon success, the API will respond with a JSON object describing the newly created template.

Components

The components value in the request must be an array of objects that describes each component that makes up the template. Authentication templates must have the following components:

  • a single body component

  • a single footer component

  • a single OTP Button component

Properties

Placeholder
Description
Sample Value

<ADD_SECURITY_RECOMMENDATION>

Optional.

Boolean. Set to true if you want the template to include the string: For your security, do not share this code. Set to false to exclude the string.

true

<CODE_EXPIRATION_MINUTES>

Optional.

Integer. Indicates number of minutes the password or code is valid.

If omitted, the code expiration warning will not be displayed in the delivered message.

Minimum 1, maximum 90.

5

<OTP_TYPE>

Enum. Indicates button type. Set to COPY_CODE if you want the template to use a copy code button, or ONE_TAP to have it use a one-tap autofill button.

ONE_TAP

<TEXT>

String. Copy code button text.

Maximum 25 characters.

'Copy Code'

<AUTOFILL_TEXT>

One-tap buttons only.

String. One-tap button text.

Maximum 25 characters.

'Autofill'

<PACKAGE_NAME>

One-tap buttons only.

Your Android app's package name.

'com.example.myapplication'

<SIGNATURE_HASH>

One-tap buttons only.

'K8a%2FAINcGX7'

Sample request with components descriptions

    {
        "name": "sample",
        "language": "es_ES",
        "category": "AUTHENTICATION",
        "components": [
            {
            "type": "BODY", 
            "add_security_recommendation": "<ADD_SECURITY_RECOMMENDATION>" /*#Optional*/
            },
            {
            "type": "FOOTER", 
            "code_expiration_minutes": "<CODE_EXPIRATION_MINUTES>" /*Optional*/
            },
            { 
            "type": "BUTTONS",
            "buttons": [
                    {
                "type": "OTP",
                "otp_type": "<OTP_TYPE>",
                "text": "<TEXT>",
                "autofill_text": "<AUTOFILL_TEXT>", /*One-tap buttons only*/
                "package_name": "<PACKAGE_NAME>", /*One-tap buttons only*/
                "signature_hash": "<SIGNATURE_HASH>" /*#One-tap buttons only*/
                    }
                ]
            }
        ],
    }

Sample Copy Code Button Components Value

[
  {
    "type": "BODY", 
    "add_security_recommendation": true
  }, 
  {
    "type": "FOOTER", 
    "code_expiration_minutes": 5
  },
  { 
    "type": "BUTTONS",
    "buttons": [
      {
        "type": "OTP",
        "otp_type": "COPY_CODE",
        "text": "Copy Code"
      }
    ]
  }
]

Sample One-tap Autofill Button Components Value

[
  {
    "type": "BODY", 
    "add_security_recommendation": true
  }, 
  {
    "type": "FOOTER", 
    "code_expiration_minutes": 5
  },
  { 
    "type": "BUTTONS",
    "buttons": [
      {
        "type": "OTP",
        "otp_type": "ONE_TAP",
        "text": "Copy Code",
        "autofill_text": "Autofill",
        "package_name": "com.example.myapplication",
        "signature_hash": "K8a%2FAINcGX7"
      }
    ]
  }
]

Sending Authentication Templates

POST https://waba-v2.360dialog.io/messages

Request Body

Name
Type
Description

name

String

Name of the template.

type

String

Message type

to

String

Recipient wa_id

messaging_product

String

Required only for Cloud API. Messaging service used for the request. Use "whatsapp".

components

String

language

String

Placeholder
Description
Sample Value

<CUSTOMER_PHONE_NUMBER>

The customer's WhatsApp phone number.

12015553931

<ONE-TIME PASSWORD>

The one-time password or verification code to be delivered to the customer.

Note that this value must appear twice in the payload.

J$FpnYnP

<TEMPLATE_LANGUAGE_CODE>

en_US

<TEMPLATE_NAME>

The template's name.

verification_code

Sample payload with Copy Code Button

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<CUSTOMER_PHONE_NUMBER>",
  "type": "template",
  "template": {
    "name": "<TEMPLATE_NAME>",
    "language": {
      "code": "<TEMPLATE_LANGUAGE_CODE>"
    }
  },
  "components": [
    {
      "type": "body",
      "parameters": [
        {
          "type": "text",
          "text": "<ONE-TIME PASSWORD>"
        }
      ]
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "OTP",
          "otp_type": "COPY_CODE",
          "text": "Copy Code"
        }
      ]
    }
  ]
}

[will be deprecated] If the WABA is registered in On-Premise API

As announced in November 2023, Meta is transitioning to a fully Cloud-hosted WhatsApp Business Platform and will stop supporting On-Premise API in October 2025. Starting from On-Premise client v2.53, all new feature updates will be exclusively delivered to Cloud API. While the On-Premise API client will receive quarterly releases, they will focus solely on bug fixes and security patches.

POST https://waba.360dialog.io/v1/messages

Request Body

Name
Type
Description

to

Recepient_wa_id

language

String

Contains a language object. Specifies the language the template may be rendered in.

The language object can contain the following fields:

policystring – Required. The language policy the message should follow. The only supported option is deterministic.

codestring – Required. The code of the language or locale to use.

Accepts both language andlanguage_locale formats (e.g., en and en_US).

name

String

Name of the template.

namespace

Namespace of the template.

components

String

If a template is sent to an account that is incapable of receiving the authentication template, the 1026 (ReceiverIncapable) error will be sent in the error object to the configured Webhook server.

Sample payload with Copy Code Button

{
    "to": "wa_id",
    "type": "template",
    "template": {
        "namespace": "c8ae5f90_307a_ca4c_b8f6_d1e2a2573574",
        "language": {
            "policy": "deterministic",
            "code": "en"
        },
        "name": "template_name",
        "components":[
  {
    "type": "BODY", 
    "add_security_recommendation": true
  }, 
  {
    "type": "FOOTER", 
    "code_expiration_minutes": 5
  },
  { 
    "type": "BUTTONS",
    "buttons": [
      {
        "type": "OTP",
        "otp_type": "COPY_CODE",
        "text": "Copy Code"
      }
    ]
  }
]

URLs, media, and emojis are not supported. Because authentication templates with OTP buttons only consist of preset text and buttons, their risk of being is significantly minimized.

Zero Tap Authentication Templates allow your users to receive one-time passwords or codes via WhatsApp without having to leave your app. See See to learn how to use them.

See Meta's Official documentation for and .

See .

Make it clear to your user that the password or code will be delivered to their WhatsApp phone number, especially if you offer multiple ways for the user to receive password or code delivery. See for additional tips.

to follow before you enable zero-tap authentication templates for WhatsApp business accounts

See above.

Note that even if your template is using a one-tap autofill button, this value must still be supplied. If Meta's unable to validate your the authentication template message will display a copy code button with this text instead.

Your app signing key hash. See Meta's Official documentation for .

See

The template's .

See

Zero-Tap Authentication Templates
Handshake
App Signing Key Hash
See more of Meta best practices
See differences between On-premise API and Cloud API
Learn how to change hosting type of registered numbers
See differences between On-premise API and Cloud API
Learn how to change hosting type of registered numbers
View list of supported languages here.
handshake
App Signing Key Hash
View list of supported languages here.
language and locale code
Buttons
Components
Components
authentication template with a one-time password button
paused
Customizing Time-To-Live
Template Messages
Enable Cloud API in your Partner Hub to be able to register Cloud API numbers
Enable Cloud API in your Partner Hub to be able to register Cloud API numbers