# 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.

<figure><img src="/files/yQSEcl4XDS5f2hIony5y" alt=""><figcaption></figcaption></figure>

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.

{% hint style="warning" %}
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.
{% endhint %}

## 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.&#x20;

#### In the API

Use the create template [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#post-v1-configs-templates)  and assemble the components in the request:

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<mark style="color:red;">\*</mark>       | string          |                                                                                                                                            |
| components<mark style="color:red;">\*</mark> | array\[objects] | Array of objects that describe the components that make up the template.                                                                   |
| category<mark style="color:red;">\*</mark>   | string          | Allowed values: **`AUTHENTICATION`**                                                                                                       |
| language<mark style="color:red;">\*</mark>   | string          | [View list of supported languages here.](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages) |

{% tabs %}
{% tab title="200: OK " %}
Upon success, the API will respond with a JSON object describing the newly created template.

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

{% endtab %}
{% endtabs %}

#### Post Body <a href="#post-body" id="post-body"></a>

```json
{
  "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 <a href="#properties" id="properties"></a>

<table><thead><tr><th width="297.3333333333333">Placeholder</th><th width="326">Description</th><th>Example Value</th></tr></thead><tbody><tr><td><p><code>&#x3C;AUTOFILL_BUTTON_TEXT></code></p><p><em>String</em></p></td><td><p><strong>Optional.</strong></p><p><br></p><p>One-tap autofill button label text.</p><p><br></p><p>Maximum 25 characters.</p><p><br></p><p>If omitted, the autofill text will default to a pre-set value, localized to the template's language. For example, <code>Autofill</code> for English (US).</p></td><td><code>Autofill</code></td></tr><tr><td><p><code>&#x3C;CODE_EXPIRATION></code></p><p><em>Integer</em></p></td><td><p><strong>Optional.</strong></p><p><br></p><p>Indicates the number of minutes the password or code is valid.</p><p><br></p><p>If included, the code expiration warning and this value will be displayed in the delivered message. The button will be disabled in the delivered message the indicated number of minutes from when the message was sent.</p><p><br></p><p>If omitted, the code expiration warning will not be displayed in the delivered message. In addition, the button will be disabled 10 minutes from when the message was sent.</p><p><br></p><p>Minimum 1, maximum 90.</p></td><td><code>5</code></td></tr><tr><td><p><code>&#x3C;COPY_CODE_BUTTON_TEXT></code></p><p><em>String</em></p></td><td><p><strong>Optional.</strong></p><p><br></p><p>Copy code button label text.</p><p><br></p><p>If omitted, the text will default to a pre-set value localized to the template's language. For example, <code>Copy Code</code> for English (US).</p><p><br></p><p>If included, the authentication template message will display a copy code button with this text if the message fails the <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/autofill-button-authentication-templates#eligibility-check">eligibility check</a>.</p><p><br></p><p>Maximum 25 characters.</p></td><td><code>Copy Code</code></td></tr><tr><td><p><code>&#x3C;PACKAGE_NAME></code></p><p><em>String</em></p></td><td><p><strong>Required.</strong></p><p><br></p><p>Your Android app's package name.</p></td><td><code>com.example.myapplication</code></td></tr><tr><td><p><code>&#x3C;SECURITY_RECOMMENDATION></code></p><p><em>Boolean</em></p></td><td><p><strong>Optional.</strong></p><p><br></p><p>Set to <code>true</code> if you want the template to include the string, <em>For your security, do not share this code.</em> Set to <code>false</code> to exclude the string.</p></td><td><code>true</code></td></tr><tr><td><p><code>&#x3C;SIGNATURE_HASH></code></p><p><em>String</em></p></td><td><p><strong>Required.</strong></p><p><br></p><p>Your app signing key hash. See <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/autofill-button-authentication-templates#app-signing-key-hash">App Signing Key Hash</a> below.</p></td><td><code>K8a%2FAINcGX7</code></td></tr><tr><td><p><code>&#x3C;TEMPLATE_LANGUAGE></code></p><p><em>String</em></p></td><td><p><strong>Required.</strong></p><p><br></p><p>Template <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages">language and locale code</a>.</p></td><td><code>en_US</code></td></tr><tr><td><p><code>&#x3C;TEMPLATE_NAME></code></p><p><em>String</em></p></td><td><p><strong>Required.</strong></p><p><br></p><p>Template name.</p><p><br></p><p>Maximum 512 characters.</p></td><td><code>verification_code</code></td></tr><tr><td><p><code>&#x3C;TIME_TO_LIVE></code></p><p><em>Integer</em></p></td><td><p><strong>Optional.</strong></p><p><br></p><p>Authentication message time-to-live value, in seconds. See <a href="/pages/G1Pl0DYYkDyeWDAd7lVG#time-to-live">Time-To-Live </a>.</p></td><td><code>60</code></td></tr></tbody></table>

#### Example Request <a href="#example-request" id="example-request"></a>

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.

```json
{
  "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 <a href="#example-response" id="example-response"></a>

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

## Sending One-Tap Autofill Authentication Templates&#x20;

See our[ Authentication Templates documentation ](/partner/messaging/template-messages/authentication-templates.md)to learn how to send it to customers.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.360dialog.com/partner/messaging/template-messages/authentication-templates/one-tap-autofill-authentication-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
