Authentication templates

Send verification codes on WhatsApp, with Meta's copy-code button.

WhatsApp allows one-time codes only in an authentication template. Meta writes its words, and adds a button that copies the code. You make the template in WhatsApp Manager, then send it from Goomzo like any other.

Requirements

  • Your WhatsApp number connected in Integrations → WhatsApp.
  • An API key with the messages.send permission.

Step 1: Make the template in WhatsApp Manager

  1. In WhatsApp Manager, create a template in the Authentication category.
  2. Choose Copy code for its button, and the languages you need.
  3. Submit it. Meta reviews it, usually within minutes.

Step 2: Sync your templates

In Integrations → WhatsApp, select Sync templates from Meta. Goomzo also syncs every few hours, and when Meta reports a change. The template shows as approved once Meta approves it.

Step 3: Save it as a Goomzo template

Name the WhatsApp template, and set its code to {{secret.code}}:

curl https://api.goomzo.africa/v1/templates \
  -H "Authorization: Bearer $GOOMZO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "auth_whatsapp",
    "channel": "whatsapp",
    "whatsapp": { "name": "login_code", "language": "en", "values": { "body.1": "{{secret.code}}" } }
  }'

You give only the body's code. Goomzo puts the same code in the copy-code button.

Step 4: Send it

curl https://api.goomzo.africa/v1/messages \
  -H "Authorization: Bearer $GOOMZO_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: login-7f3a" \
  -d '{ "messages": [{ "to": "+255712345678", "template": "auth_whatsapp", "variables": { "code": "482913" } }] }'

The customer gets the code, with a button that copies it. Goomzo keeps the message as ••••••, marked private.

Important: A template sends to anyone with WhatsApp, whether they've written to you or not.

Notes

  • One code: an authentication template carries one value, the code. Meta allows up to 15 characters.
  • Price: Meta charges authentication templates at their own rate, to your WhatsApp account.
  • SMS too: an SMS template with {{secret.code}} works the same way, for people without WhatsApp.

Next steps

Last updated