How do I send an OTP code for logging into my app?
A verification code (OTP) is a special template category on WhatsApp. Its rules differ from an ordinary notification, and this is where the confusion usually starts: you do not write the wording. Meta composes the text, in the language you pick. If you type your own "{{1}} is your verification code", the submission will be rejected.
Creating one in the dashboard
- Open Templates and choose the 🔑 Verification code category. The message body field disappears on its own, which is intentional.
- Give it a name, for example
login_verification. - Set three things and nothing else:
- How many minutes it stays valid, which appears as the footer "This code expires in 5 minutes".
- The copy button label, the button that lets the recipient copy the code instead of retyping it.
- The security note, the "do not share this code" line.
- Submit to Meta. OTP templates are usually approved faster than other categories.
What the recipient sees
123456 is your verification code. For your security, do not share this code. This code expires in 5 minutes. [ Copy code ]
Sending it from your application
Exactly like any other template through POST /api/v1/kirim: send the template name and
one value, the code. We handle the technical part for you. The code has to be sent
to Meta twice, once for the text and once for the copy button, and you never have to think about
it.
{
"nomor": "628123456789",
"template": "login_verification",
"isi": ["123456"]
}
What it costs
The verification category is billed by Meta per message, at a rate comparable to a utility notification, paid directly to Meta with no markup from us. See when a template is required.