Guides
Authentication OTP Templates
Send Meta AUTHENTICATION templates for login / verification codes through
POST /templates/send with a single OTP in body_variables.
Cloud templates only
OTP templates require an approved AUTHENTICATION template on a Cloud API channel. Device/QR channels do not send Meta authentication templates.
1. Create the template (dashboard)
- Templates → Create → category AUTHENTICATION.
- Configure the OTP button (copy code / one-tap) per Meta’s authentication template rules.
- Submit for Meta approval and wait until status is approved.
2. Send the code
Pass exactly one body_variables entry: the numeric OTP (4–8 digits). Washeej validates the payload and attaches the matching button parameter when the template requires it.
cURL
curl -X POST "https://staging-mobile.washeej.com/v1/templates/send" \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"template_id": "YOUR_AUTH_TEMPLATE_ID",
"mobile_code": "966",
"mobile": "500000000",
"whatsapp_account_id": YOUR_CLOUD_ACCOUNT_ID,
"body_variables": ["482913"]
}'
3. Validation rules
- Category must be AUTHENTICATION.
body_variableslength must be1.- Code must match
/^\d{4,8}$/. - Wrong shape →
validation_errorwith a clear message.
4. Operational tips
- Generate codes in your auth service; never reuse long-lived OTPs in examples on production numbers.
- Prefer a dedicated Cloud number for transactional OTP traffic.
- Monitor
message.failed/billing_blockedfor deliverability and Meta billing issues. - List templates with
GET /templatesand filter to your Cloudwhatsapp_account_id.