> ## Documentation Index
> Fetch the complete documentation index at: https://docs.watx.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication templates

> One-time-code templates: the wording Meta writes for you, copy-code, one-tap and zero-tap buttons, Android app details, code expiry, and how to send a code.

An authentication template delivers a one-time code — for a login, a sign-up or confirming an action. It is a [message template](/whatsapp/templates) like any other, except that Meta writes the wording and you choose only how it behaves. Your own system generates the code and checks it when the customer types it back; Watx only delivers it.

To create one, open **WhatsApp → Templates → New Template → Start from scratch** and set **Category** to **Authentication**. The editor changes completely: there is no body, header, footer or button list to fill in.

## What the customer sees

Meta writes the message and translates it into the template's language. The editor shows it read-only:

> **123456** is your verification code. For your security, do not share this code.

Below it, Meta adds an expiry line if you set one, and a button that copies or fills in the code.

## Settings

| Setting | What it does |
| - | - |
| **Add the security warning** | Appends "For your security, do not share this code." Recommended by Meta |
| **Code expires after** | 1 to 90 minutes. Meta renders it as "This code expires in N minutes." Leave it empty for no expiry line |
| **How they get the code** | **Copy code**, **One-tap autofill** or **Zero-tap** — see below |
| **Button label (optional)** | Up to 25 characters. Left empty, Meta uses its own translated label — usually the better choice, since yours is not translated |

### How they get the code

| Option | What it does | What it needs |
| - | - | - |
| **Copy code** | A button copies the code. Works on every device | Nothing. Start here |
| **One-tap autofill** (Advanced) | Fills the code into your own Android app with one tap | Your Android app's details |
| **Zero-tap** (Advanced) | Your Android app reads the code with no tap at all | Your Android app's details, and accepting the zero-tap terms |

### Your Android app

One-tap and zero-tap deliver the code into your own Android app, so Meta needs to know which app it is.

* **App package name** — for example `com.example.myapp`: at least two parts separated by dots, each starting with a letter, using only letters, digits and underscores.
* **App signature hash** — exactly 11 characters: letters, digits, `+`, `/` or `=`.
* **Add another app** — up to five. Use it for the same app signed another way: a build installed from Google Play and a test build you install yourself have different signature hashes. Pasting several values separated by commas fills one row each. The same package name and hash cannot be listed twice.
* **Autofill label (optional)** — up to 25 characters.

If you do not have an Android app, use **Copy code**.

### Zero-tap terms

Zero-tap shows a checkbox, **I accept the zero-tap terms**. Zero-tap is subject to the WhatsApp Business Terms of Service, and your customers must expect the code to be filled in for them automatically. Meta refuses a zero-tap template without it, and Watx never ticks it for you.

## Submitting

**Submit for Approval** works as for any template, and the template goes through the same [statuses](/whatsapp/templates#submitting-and-statuses). If something is missing — a package name, a hash of the wrong length, the zero-tap terms — the submit is refused with a sentence naming it.

**Sync from Meta** brings authentication templates created elsewhere into Watx with their button type and every app they list, so editing one later keeps its settings.

## Sending a code

Send a code through the Watx API: `POST /v1/messages` with `type: "template"`, the template's name and language, and the code as the only parameter.

```json theme={null}
{
  "to": "+919876543210",
  "type": "template",
  "template": {
    "name": "login_code",
    "language": "en_US",
    "params": ["123456"]
  }
}
```

The code can be up to 15 characters. WhatsApp puts it in the message and on the copy or autofill button. The key needs the `messages:send` scope — see [Authentication](/api/authentication) and the [API introduction](/api/introduction).

The code icon on the template's card in **WhatsApp → Templates** shows this exact request for that template, with a runnable `curl`.

<Warning>
  The inbox, campaigns, automations and flows have no field for a one-time code, so an authentication template cannot be sent from them: a send from the inbox fails, and a [campaign](/whatsapp/broadcasts) using one is refused before anything is sent.
</Warning>

## Related

* [Message templates](/whatsapp/templates) — creating, submitting and editing templates.
* [API introduction](/api/introduction) — keys, base URL and your first request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.