DocsCore APIs

Templates & Variables API

Query approved Meta WhatsApp templates, inspection variable formats, language codes, and understand template synchronization.

5 min readAPI v1

Meta WhatsApp Template Lifecycle

WhatsApp requires business-initiated messages outside the 24-hour service window to use pre-approved Meta message templates. * **PingStack Template Registry**: Mirrors approved templates from your WhatsApp Business Account (WABA). * **Meta WhatsApp Cloud API**: Performs template review, approval (`APPROVED`, `PENDING`, `REJECTED`), and quality rating monitoring. * **Synchronization**: PingStack continuously synchronizes approved templates so that newly approved templates in Meta Business Manager become instantly available for Developer API dispatches.

Positional Variables Schema

Approved templates use numbered placeholders: `{{1}}`, `{{2}}`, `{{3}}`. When sending via API: 1. Provide variables matching the exact placeholder count. 2. Positional variables can be supplied as a numbered object (`{"1": "Value", "2": "Value"}`) or an ordered array (`["Value1", "Value2"]`). 3. Always supply the exact `language` code (e.g. `en_US`, `hi`, `es`) configured for that template variation.

List & Fetch Templates

* `GET /api/v1/templates?status=APPROVED` — Lists approved templates ready for messaging. * `GET /api/v1/templates/{id}` — Fetches template details, variable structure, and category.
# List Approved Templates
curl "https://app.pingstack.in/api/v1/templates?status=APPROVED" \
  -H "Authorization: Bearer ps_secret_live_YOUR_API_KEY"

# Fetch Template by ID or Name
curl "https://app.pingstack.in/api/v1/templates/fee_reminder" \
  -H "Authorization: Bearer ps_secret_live_YOUR_API_KEY"