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:
| Block | Required | Description |
|---|---|---|
| Authentication body | Yes | Auto-generated message with OTP code, security disclaimer, and expiration |
| Authentication action | Yes | Copy-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.
Contoh kode
{
"type": "authentication-body",
"authenticationBody": {
"addSecurityDisclaimer": true,
"expirationTime": 30
}
}| Property | Required | Type | Description |
|---|---|---|---|
| addSecurityDisclaimer | Yes | boolean | Whether to include a "Do not share this code" security warning |
| expirationTime | Yes (nullable) | integer (1--90) or null | Number of minutes before the code expires. If set to a number, the message includes an expiration notice. Set to null to omit the expiration. |
| messageSendTtlSeconds | No | integer (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:
Contoh kode
{
"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.
Contoh kode
{
"type": "authentication-action",
"authenticationAction": {
"oneTap": {
"androidPackageName": "com.example.myapp",
"androidSignatureHash": "abc123def456"
}
}
}| Property | Required | Description |
|---|---|---|
| oneTap.androidPackageName | Yes | Your Android app's package name |
| oneTap.androidSignatureHash | Yes | Your 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.
Contoh kode
{
"type": "authentication-action",
"authenticationAction": {
"zeroTap": {
"supportedApps": [
{
"packageName": "com.example.myapp",
"signatureHash": "abc123def456"
}
],
"zeroTapTermsAccepted": true
}
}
}| Property | Required | Description |
|---|---|---|
| zeroTap.supportedApps | Yes | Array of apps that support zero-tap. Each needs packageName and signatureHash. |
| zeroTap.zeroTapTermsAccepted | Yes | Whether 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
Contoh kode
{
"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
Contoh kode
{
"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
Contoh kode
{
"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
| Feature | Authentication template | Copy code in text/coupon template |
|---|---|---|
| Category | AUTHENTICATION only | UTILITY or MARKETING |
| Message content | Auto-generated by Meta | Custom body text |
| Security disclaimer | Built-in option | Not available |
| Expiration notice | Built-in option | Not available |
| One-tap / zero-tap | Supported | Not available |
| Additional buttons | Not allowed | Allowed |
| Delivery priority | Optimized by Meta | Standard |
Related
- Text Template Blocks -- Standard text templates with copy code buttons
- Coupon Template Blocks -- Promotional codes with custom messaging
- Creating WhatsApp Message Templates -- Full template creation workflow