One-Tap Autofill Authentication Templates

One-tap autofill authentication templates allow you to send a one-time password or code along with an one-tap autofill button to your users. When a WhatsApp user taps the autofill button, the WhatsApp client triggers an activity which opens your app and delivers it the password or code.

One-tap autofill button authentication templates consist of:

  • Preset text: <VERIFICATION_CODE> is your verification code.

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

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

  • A one-tap autofill button.

One-tap autofill buttons are only supported on Android. If you send an 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.

Template Creation

You can use the WABA API to create One-tap autofill authentication templates. Alternatively, users can also create it using the WhatsApp Business Manager.

In the API

Use the create template endpoint and assemble the 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 [base-url]/v1/configs/templates

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

Headers

Request Body

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

{
    "id": "594425479261596",
    "status": "PENDING",
    "category": "AUTHENTICATION"
}

Post Body

{
  "name": "<TEMPLATE_NAME>",
  "language": "<TEMPLATE_LANGUAGE>",
  "category": "authentication",
  "message_send_ttl_seconds": <TIME_T0_LIVE>, // Optional
  "components": [
    {
      "type": "body",
      "add_security_recommendation": <SECURITY_RECOMMENDATION> // Optional
    },
    {
      "type": "footer",
      "code_expiration_minutes": <CODE_EXPIRATION> // Optional
    },
    {
      "type": "buttons",
      "buttons": [
        {
          "type": "otp",
          "otp_type": "one_tap",
          "text": "<COPY_CODE_BUTTON_TEXT>",  // Optional
          "autofill_text": "<AUTOFILL_BUTTON_TEXT>", // Optional
          "package_name": "<PACKAGE_NAME>",
          "signature_hash": "<SIGNATURE_HASH>"
        }
      ]
    }
  ]
}

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.

Properties

Example Request

This example creates a template named "authentication_code_autofill_button" categorized as authentication with all optional text strings enabled and a one-tap autofill button.

{
  "name": "authentication_code_autofill_button",
  "language": "en_US",
  "category": "authentication",
  "message_send_ttl_seconds": 60,
  "components": [
      {
          "type": "body",
          "add_security_recommendation": true
      },
      {
          "type": "footer",
          "code_expiration_minutes": 10
      },
      {
          "type": "buttons",
          "buttons": [
              {
                  "type": "otp",
                  "otp_type": "one_tap",
                  "text": "Copy Code",
                  "autofill_text": "Autofill",
                  "package_name": "com.example.luckyshrub",
                  "signature_hash": "K8a%2FAINcGX7"
              }
          ]
      }
  ]
}'

Example Response

{
  "id": "594425479261596",
  "status": "PENDING",
  "category": "AUTHENTICATION"
}

Sending One-Tap Autofill Authentication Templates

See our Authentication Templates documentation to learn how to send it to customers.

Last updated