Meta guidelines for OTP templates
Meta enforces strict formatting and security policies on authentication templates:- No media allowed: You cannot add images, video files, or document attachments.
- No external links: The template cannot contain URL buttons or custom phone numbers.
- Copy Code buttons: Must be configured as a button of type
copy_codewith the dynamic OTP parameter bound to it.
Dynamic parameters mapping
When sending an OTP template with a Copy Code button, you must provide parameters for both the message body and the button. Suppose your template is configured as:- Body:
"{{1}} is your verification code. For security, do not share this code." - Button: Copy Code
- A body parameter: the code (e.g.,
582910). - A button parameter: the code itself to be copied by the button (e.g.,
582910).
Send code example
Use the following request pattern to dispatch an OTP code:Troubleshooting
Button does not copy the code
Make sure theindex matches the zero-based index of the Copy Code button in your template configuration (usually 0 if it is the only button). Ensure the sub_type is set exactly to "copy_code".