An authentication template lets you send one-time passcodes (OTP) for sign-in or account verification. Meta writes the text of these templates: the recipient sees the code and, if you want, a security note and how long the code is valid. You only decide how the code is delivered and set a few options.
Creating one
- On Templates, select Create template.
- Set the Template name and Language, and choose Authentication as the category. The format choice disappears; authentication templates have a single format.
- In Verification message, choose How the code is delivered (see below).
- Set Add security note and Show expiry time.
- When Meta checks are complete, select Send for Meta approval.
The preview shows the text Meta will generate, such as “123456 is your verification code.” It’s written in the template’s language and can’t be changed.
How the code is delivered
| Option | What happens | What you need |
|---|---|---|
| Copy code | What happensThe recipient taps the button and the code is copied, then pastes it into your app or site. | What you needOnly the Copy button text. |
| One-tap | What happensThe recipient taps the button and your Android app fills in the code. | What you needYour Android app’s package name and signing hash; optional Autofill button text. |
| Zero-tap | What happensThe code reaches your Android app without any tap. | What you needEverything one-tap needs, plus ticking I accept the zero-tap terms. |
- Under Android apps you can add up to 5 apps. Each needs its package name (e.g.
com.example.app) and the 11-character app signing hash. Get these from the team that builds your app. - One-tap and zero-tap only work on Android. If the app isn’t installed or the recipient uses an iPhone, the button shows as copy code and uses the Copy button text.
- With zero-tap you agree that the code is only used for the sign-in the recipient asked for and that your app says so clearly. Your app must also implement what Meta requires for this method; see Meta’s documentation.
Other options
- Add security note: adds “For your security, do not share this code.” Leaving it on is recommended.
- Show expiry time: the footer says how many minutes the code is valid, from 1 to 90. This is information only; your own system decides when the code actually expires.
- Limit delivery time: the code isn’t sent if it can’t be delivered in time. You can choose 30 seconds to 15 minutes. Use it when a late code would be useless.
Sending the code
The template doesn’t hold a code; you provide it with every send. Verification codes are usually sent automatically from your own app or site the moment a user asks for one. You do that with the Broadycast API; see API keys.
To start from a ready-made one, the Authentication category on Library has two examples. See Ready-made template libraries.
Common issues
Frequently asked
com.company.app) and the signing hash exactly 11 characters. Remove any app row you left empty.Meta’s official information: Authentication templates.