---
title: "Authentication templates"
description: "Send verification codes on WhatsApp, with Meta's copy-code button."
url: "https://docs.goomzo.africa/docs/developers/templates/authentication"
docs_index: /llms.txt
lastUpdated: 2026-11-12
section: "Templates"
related:
  - /docs/developers/templates
  - /docs/developers/templates/create
---

> For an index of all documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt). Any page is also available as Markdown by adding .md to its URL.

# 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}}`:

```bash
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

```bash
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

- [Send templates](https://docs.goomzo.africa/docs/developers/messages/templates?utm_source=llms&utm_medium=ai)
- [Webhook events](https://docs.goomzo.africa/docs/developers/webhooks/events?utm_source=llms&utm_medium=ai)

---

For an index of all available documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt)
