Guides/Messages & templates

How do I send an OTP code for logging into my app?

Verification templates have their own rules. Meta writes the wording, you set three things. 2 min read

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

  1. Open Templates and choose the 🔑 Verification code category. The message body field disappears on its own, which is intentional.
  2. Give it a name, for example login_verification.
  3. 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.
  4. 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"]
}
You generate the code, not us. Produce six random digits in your own application, store them with a short expiry, then send them through this template. Never use anything guessable such as a sequence number or a date of birth.

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.

Still stuck after following this guide? Contact us from the dashboard — attach a screenshot if you have one, it speeds everything up.