Skip to main content

Introduction

Template management endpoints allow you to retrieve, inspect, and create WhatsApp message templates. Templates are pre-approved message formats required by WhatsApp for business communications.

📋 Get Available Templates

Retrieve all templates available for your company and phone number.

Endpoint

Query Parameters

Example Request:

Response

The API returns an array of template objects (not wrapped in an object).
Important Notes:
  • Response is a direct array, not an object with a “templates” key
  • status values are in UPPERCASE: "APPROVED", "PENDING", "REJECTED"
  • category values are in UPPERCASE: "MARKETING", "UTILITY", "AUTHENTICATION"
  • Each template includes parameter_format (typically "POSITIONAL")
  • components array shows the template structure but NOT which components are dynamic

🔍 Get Template Components

Retrieve detailed information about a specific template’s components and structure.

Endpoint

Query Parameters

Example Request:

Response

This endpoint returns ONLY the dynamic components that you need to provide when sending a notification.
Response Structure:
  • status: Always "OK" if successful
  • components: Array of strings listing the dynamic component names you must provide
Example Responses: Template with image header and 2 body variables:
Template with only body variables (no media):
Template with static content only (no dynamic components):
Template with video header:
Template with PDF document:
Template with dynamic URL button:
Important Notes:
  • This endpoint does NOT return the full template structure
  • It only returns the names of components you need to provide when sending the notification
  • Footer and static buttons are NOT included (they’re static in the template)
  • Component names follow the pattern:
    • Headers: header_image, header_video, header_document (no suffix number)
    • Body variables: body_text_0, body_text_1, body_text_N (with index)
    • Button URLs: buttons_url_0, buttons_url_1 (with index)

🆕 Create New Template

Create a new WhatsApp message template for approval by Meta.

Endpoint

Headers

Body Request

Required Parameters

Template Categories

Component Types

  • format: "TEXT", "IMAGE", "VIDEO", "DOCUMENT"
  • text: Text content (only for TEXT format)
  • example: Example for variables

BODY

  • text: Main message content
  • Variables: Use {1}, {2}, etc. for dynamic content (single braces in template creation)
  • text: Footer text (static only, no variables)

BUTTONS

Array of button objects: URL Button:
Quick Reply Button:

Response

Template Approval Process

  1. Submission: Template is sent to Meta for review
  2. Review: Meta reviews template (usually 24-48 hours)
  3. Approval/Rejection: Template is approved or rejected with feedback
  4. Usage: Approved templates can be used in notifications

Template Status Values


📝 Template Best Practices

Naming Conventions

  • Use lowercase letters only
  • Use underscores for spaces
  • Be descriptive: welcome_new_user vs template1
  • Include language if multiple: welcome_es, welcome_en

Content Guidelines

  • Be Clear: Templates should be easily understood
  • Variables: Use numbered placeholders {1}, {2}, {3} (WhatsApp uses positional variables)
  • Compliance: Follow WhatsApp commerce policies
  • Testing: Test with real data before submission

Common Rejection Reasons

  • ❌ Generic greetings (“Hello”, “Hi there”)
  • ❌ Promotional language in UTILITY templates
  • ❌ Missing context or unclear purpose
  • ❌ Incorrect variable usage
  • ❌ Policy violations (spam, inappropriate content)

Approval Tips

  • ✅ Include specific business context
  • ✅ Use clear, professional language
  • ✅ Provide meaningful examples
  • ✅ Follow WhatsApp template guidelines
  • ✅ Test variable substitution thoroughly

🔧 Development Tips

  • Cache template information to reduce API calls
  • Monitor template status changes
  • Have fallback templates for rejected ones
  • Use consistent naming across your organization
  • Document templates for team reference