WWaSphere Docs
Features

Message Templates

Create and send approved Meta message templates from WaSphere — categories, variables, the 24-hour window, and why templates require the Meta Cloud API provider.

Message Templates

A message template is a pre-approved WhatsApp message. It is the only way to start a conversation with someone outside the 24-hour customer-service window — order updates, appointment reminders, one-time passcodes.

Templates are a Meta Cloud API feature. A session running on Baileys returns a capability error (501) when you try to send one. See Meta Cloud API for enabling the provider.

The 24-hour window

Meta lets you send free-form messages to a person only within 24 hours of their last message to you. Outside that window, free-form sends are refused and a template is the only route.

This is exactly what the freeformAlways capability reports: true on Baileys (no window at all), false on Meta. Check it rather than guessing:

curl https://api.yourdomain.com/workspaces/{workspaceId}/proxy/api/sessions/notifications/capabilities \
  -H "Authorization: Bearer wsk_your_key"

Listing approved templates

WaSphere pulls your approved templates straight from WhatsApp Manager, so there is nothing to keep in sync:

curl https://api.yourdomain.com/workspaces/{workspaceId}/proxy/api/sessions/notifications/templates \
  -H "Authorization: Bearer wsk_your_key"

Baileys sessions return an empty list. In the dashboard, the composer's template picker shows the same list.

Sending a template

curl -X POST https://api.yourdomain.com/workspaces/{workspaceId}/proxy/api/messages/template \
  -H "Authorization: Bearer wsk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "447700900123",
    "name": "order_update",
    "languageCode": "en_US",
    "bodyParams": ["Ali", "A123", "shipped"]
  }'
FieldRequiredNotes
toyesRecipient phone number or JID
nameyesThe approved template's name
languageCodeyesLanguage code, e.g. en_US
bodyParamsnoValues for {{1}}, {{2}}, … in body order. Up to 20.

bodyParams is positional — the first entry fills {{1}}, the second {{2}}, and so on. A template body of Hi {{1}}, your order {{2}} is {{3}}. with the params above sends "Hi Ali, your order A123 is shipped."

Creating a template

New in v1.3. You can build and submit a template from WaSphere's composer instead of switching to WhatsApp Manager. Meta Cloud API sessions only.

curl -X POST https://api.yourdomain.com/workspaces/{workspaceId}/proxy/api/sessions/notifications/templates \
  -H "Authorization: Bearer wsk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "order_update",
    "category": "UTILITY",
    "language": "en_US",
    "headerText": "Order update",
    "body": "Hi {{1}}, your order {{2}} is {{3}}.",
    "bodyExamples": ["Ali", "A123", "shipped"],
    "footer": "Reply STOP to opt out"
  }'
FieldRequiredRules
nameyesLowercase letters, numbers and underscores only
categoryyesUTILITY, MARKETING, or AUTHENTICATION
languageyesen or en_US form
bodyyes1–1024 characters. Use {{1}}, {{2}}, … for variables
bodyExamplesconditionalOne example value per variable — Meta requires these when the body has variables
headerTextnoUp to 60 characters
footernoUp to 60 characters

The response returns the template id and its initial status, normally PENDING.

Choosing a category

Category matters — Meta prices and polices templates by it, and submitting marketing content as UTILITY is a reliable way to get rejected.

  • UTILITY — transactional messages about an existing order or account: shipping updates, receipts, appointment reminders.
  • MARKETING — promotions, offers, re-engagement, anything selling.
  • AUTHENTICATION — one-time passcodes and verification codes.

Approval

Meta reviews every submitted template. Approval typically takes minutes to a few hours, but a template stays PENDING until Meta says otherwise and cannot be sent before it is approved. Rejections usually come down to a mismatched category, missing example values, or promotional content in a non-marketing template.

Templates are approved per WhatsApp Business Account, not per session. A template approved for your WABA is available to every Meta session using it.

On this page