Copy Code Authentication Templates
Last updated
Last updated
Copy code authentication templates allow you to send a one-time password or code along with a copy code button to your users.
When a WhatsApp user taps the copy code button, it copies the password or code to the device's clipboard. The user can then switch to your app and paste the password or code into your app.
This process does not require the HandShake and App Signing Hash.
Copy code 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 copy code button.
URLs, media, and emojis are not supported.
You can use the WABA API to create copy code authentication templates. Alternatively, users can also create it using the WhatsApp Business Manager.
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.
Upon success, the API will respond with a JSON object describing the newly created template.
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.
See our Authentication Templates documentation to learn how to send it to customers.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Placeholder | Description | Example Value |
---|---|---|
D360-API-KEY
string
name*
string
components*
array[objects]
Array of objects that describe the components that make up the template.
category*
string
Allowed values: AUTHENTICATION
language*
string
<CODE_EXPIRATION>
Integer
Optional.
Indicates the number of minutes the password or code is valid.
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.
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.
Minimum 1, maximum 90.
5
<COPY_CODE_BUTTON_TEXT>
String
Optional.
Copy code button label text.
If omitted, the text will default to a pre-set value localized to the template's language. For example, Copy Code
for English (US).
Maximum 25 characters.
Copy Code
<SECURITY_RECOMMENDATION>
Boolean
Optional.
Set to true
if you want the template to include the string, For your security, do not share this code. Set to false
to exclude the string.
true
<TEMPLATE_LANGUAGE>
String
en_US
<TEMPLATE_NAME>
String
Required.
Template name.
Maximum 512 characters.
verification_code
<TIME_TO_LIVE>
Integer
60