Sign inGet started

Authentication Templates

Authentication templates are purpose-built for sending one-time passwords (OTPs) and verification codes. They include a predefined message structure with security disclaimers, code expiration, and a copy-code button. Meta provides optimized delivery for authentication templates with higher throughput.
Authentication templates must use the AUTHENTICATION category in the deployments. Meta enforces strict content rules for this category -- the template cannot include marketing or promotional content.

Block Structure

An authentication template uses two required blocks:
BlockRequiredDescription
Authentication bodyYesAuto-generated message with OTP code, security disclaimer, and expiration
Authentication actionYesCopy-code button, with optional one-tap or zero-tap auto-fill
Authentication templates do not support custom headers, footers, or additional buttons.

Authentication Body

The authentication body block auto-generates the message content. You control the security disclaimer and expiration behavior -- Meta handles the actual message wording.
Esempio di codice
{
  "type": "authentication-body",
  "authenticationBody": {
    "addSecurityDisclaimer": true,
    "expirationTime": 30
  }
}
PropertyRequiredTypeDescription
addSecurityDisclaimerYesbooleanWhether to include a "Do not share this code" security warning
expirationTimeYes (nullable)integer (1--90) or nullNumber of minutes before the code expires. If set to a number, the message includes an expiration notice. Set to null to omit the expiration.
messageSendTtlSecondsNointeger (1--86400)Seconds after which the message itself expires and will not be delivered. Useful for time-sensitive codes.

Security disclaimer

When addSecurityDisclaimer is true, Meta appends a message like: "For your security, do not share this code."

Code expiration

When expirationTime is set (e.g., 30), Meta appends a message like: "This code expires in 30 minutes."

Message TTL

The messageSendTtlSeconds field controls how long WhatsApp will attempt to deliver the message. If the message cannot be delivered within this window, it is discarded. This prevents stale OTPs from arriving after the code has already expired.

Authentication Action

The authentication action creates the copy-code button and optionally configures one-tap or zero-tap auto-fill for mobile devices.

Standard copy code

The simplest authentication action -- a "Copy code" button:
Esempio di codice
{
  "type": "authentication-action",
  "authenticationAction": {}
}

One-tap auto-fill (Android)

One-tap authentication allows Android users to auto-fill the code with a single tap, without manually copying. Falls back to standard copy on iOS.
Esempio di codice
{
  "type": "authentication-action",
  "authenticationAction": {
    "oneTap": {
      "androidPackageName": "com.example.myapp",
      "androidSignatureHash": "abc123def456"
    }
  }
}
PropertyRequiredDescription
oneTap.androidPackageNameYesYour Android app's package name
oneTap.androidSignatureHashYesYour Android app's signature hash

Zero-tap auto-fill (Android)

Zero-tap authentication automatically fills in the code without any user interaction. Requires terms acceptance and supports multiple apps.
Esempio di codice
{
  "type": "authentication-action",
  "authenticationAction": {
    "zeroTap": {
      "supportedApps": [
        {
          "packageName": "com.example.myapp",
          "signatureHash": "abc123def456"
        }
      ],
      "zeroTapTermsAccepted": true
    }
  }
}
PropertyRequiredDescription
zeroTap.supportedAppsYesArray of apps that support zero-tap. Each needs packageName and signatureHash.
zeroTap.zeroTapTermsAcceptedYesWhether the business has accepted Meta's zero-tap terms
One-tap and zero-tap are mutually exclusive. Use one or the other, not both. Both features only work on Android -- iOS falls back to the standard copy-code experience.

Complete Example -- Standard Authentication

Esempio di codice
{
  "defaultLocale": "en",
  "deployments": [
    {
      "key": "whatsappTemplateName",
      "platform": "whatsapp",
      "value": "login_otp"
    },
    {
      "key": "whatsappCategory",
      "platform": "whatsapp",
      "value": "AUTHENTICATION"
    },
    {
      "key": "whatsappAllowCategoryChange",
      "platform": "whatsapp",
      "value": "true"
    }
  ],
  "platformContent": [
    {
      "locale": "en",
      "type": "text",
      "platform": "whatsapp",
      "channelGroupIds": [
        "3f979241-dea3-4f55-b7bb-d769eec27e51"
      ],
      "blocks": [
        {
          "type": "authentication-body",
          "authenticationBody": {
            "addSecurityDisclaimer": true,
            "expirationTime": 10,
            "messageSendTtlSeconds": 600
          }
        },
        {
          "type": "authentication-action",
          "authenticationAction": {}
        }
      ]
    }
  ],
  "supportedPlatforms": ["whatsapp"]
}

Complete Example -- One-Tap Authentication

Esempio di codice
{
  "defaultLocale": "en",
  "deployments": [
    {
      "key": "whatsappTemplateName",
      "platform": "whatsapp",
      "value": "app_verification"
    },
    {
      "key": "whatsappCategory",
      "platform": "whatsapp",
      "value": "AUTHENTICATION"
    },
    {
      "key": "whatsappAllowCategoryChange",
      "platform": "whatsapp",
      "value": "true"
    }
  ],
  "platformContent": [
    {
      "locale": "en",
      "type": "text",
      "platform": "whatsapp",
      "channelGroupIds": [
        "3f979241-dea3-4f55-b7bb-d769eec27e51"
      ],
      "blocks": [
        {
          "type": "authentication-body",
          "authenticationBody": {
            "addSecurityDisclaimer": true,
            "expirationTime": 5,
            "messageSendTtlSeconds": 300
          }
        },
        {
          "type": "authentication-action",
          "authenticationAction": {
            "oneTap": {
              "androidPackageName": "com.example.myapp",
              "androidSignatureHash": "a1b2c3d4e5f6"
            }
          }
        }
      ]
    }
  ],
  "supportedPlatforms": ["whatsapp"]
}

Complete Example -- Zero-Tap Authentication

Esempio di codice
{
  "defaultLocale": "en",
  "deployments": [
    {
      "key": "whatsappTemplateName",
      "platform": "whatsapp",
      "value": "seamless_verification"
    },
    {
      "key": "whatsappCategory",
      "platform": "whatsapp",
      "value": "AUTHENTICATION"
    },
    {
      "key": "whatsappAllowCategoryChange",
      "platform": "whatsapp",
      "value": "true"
    }
  ],
  "platformContent": [
    {
      "locale": "en",
      "type": "text",
      "platform": "whatsapp",
      "channelGroupIds": [
        "3f979241-dea3-4f55-b7bb-d769eec27e51"
      ],
      "blocks": [
        {
          "type": "authentication-body",
          "authenticationBody": {
            "addSecurityDisclaimer": true,
            "expirationTime": 5,
            "messageSendTtlSeconds": 300
          }
        },
        {
          "type": "authentication-action",
          "authenticationAction": {
            "zeroTap": {
              "supportedApps": [
                {
                  "packageName": "com.example.myapp",
                  "signatureHash": "a1b2c3d4e5f6"
                },
                {
                  "packageName": "com.example.myapp.debug",
                  "signatureHash": "x9y8z7w6v5u4"
                }
              ],
              "zeroTapTermsAccepted": true
            }
          }
        }
      ]
    }
  ],
  "supportedPlatforms": ["whatsapp"]
}

Authentication vs. Copy Code in Other Templates

FeatureAuthentication templateCopy code in text/coupon template
CategoryAUTHENTICATION onlyUTILITY or MARKETING
Message contentAuto-generated by MetaCustom body text
Security disclaimerBuilt-in optionNot available
Expiration noticeBuilt-in optionNot available
One-tap / zero-tapSupportedNot available
Additional buttonsNot allowedAllowed
Delivery priorityOptimized by MetaStandard