HomeUser GuidesAPI Reference
Get Started
HomeAPI Reference
Authentication
Branches
Contact Groups
Contacts
Conversations
Error HandlingInvoices
Messages
Orders
Rate LimitingSDKs & Code ExamplesTemplatesTicketsAPI VersioningWABA NumbersWebhooks
User GuideAPI ReferenceTemplates

Templates

API for viewing and managing approved WhatsApp templates

Reading time: 2 minutes

Templates

View and manage approved WhatsApp templates from Meta.


Get Templates List

GET{{base_url}}/templates

View all available WhatsApp templates with search support.

Query Parameters

ParameterTypeRequiredDescriptionDefault
pageintegerNoPage number1
limitintegerNoNumber of results per page100
searchTermstringNoSearch in template names-

Example Request

Example Requestbash
curl -X GET "https://api.awalchat.com/api/developer/templates?page=1&limit=100&searchTerm=welcome" \
-H "Accept: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id"

Example Response

Response200 OK
{
"status": true,
"data": [
  {
    "id": 1,
    "name": "welcome_message",
    "language": "en",
    "status": "APPROVED",
    "category": "UTILITY",
    "components": [
      {
        "type": "BODY",
        "text": "Hello {{1}}, thanks for joining!"
      }
    ]
  },
  {
    "id": 2,
    "name": "order_confirmation",
    "language": "en",
    "status": "APPROVED",
    "category": "MARKETING",
    "components": [
      {
        "type": "HEADER",
        "format": "IMAGE"
      },
      {
        "type": "BODY",
        "text": "Your order #{{1}} has been confirmed"
      }
    ]
  }
],
"meta": {
  "current_page": 1,
  "per_page": 100,
  "total": 25,
  "last_page": 1
}
}

Tip: Use searchTerm for quick search in template names.


Get Template by ID

GET{{base_url}}/templates/{id}

View details of a specific template with all components.

Path Parameters

ParameterTypeRequiredDescription
idintegerYesTemplate ID

Example Request

Example Requestbash
curl -X GET "https://api.awalchat.com/api/developer/templates/1" \
-H "Accept: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id"

Example Response

Response200 OK
{
"status": true,
"data": {
  "id": 1,
  "name": "welcome_message",
  "language": "en",
  "status": "APPROVED",
  "category": "UTILITY",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Welcome!"
    },
    {
      "type": "BODY",
      "text": "Hello {{1}}, thanks for joining {{2}}!",
      "example": {
        "body_text": [
          ["Ahmed", "our service"]
        ]
      }
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "QUICK_REPLY",
          "text": "Get Started"
        }
      ]
    }
  ],
  "created_at": "2024-01-10T10:00:00Z",
  "updated_at": "2024-01-15T14:30:00Z"
}
}

Important Notes

šŸ’”

Template Status

  • APPROVED - Approved and can be used
  • PENDING - Under review by Meta
  • REJECTED - Rejected (check rejection reason)
āš ļø

Using Templates

  • Template must be approved before use
  • Pending or rejected templates cannot be used
  • See Send WhatsApp Template for usage details
āœ…

Template Categories

  • UTILITY - Utility templates (confirmations, notifications)
  • MARKETING - Marketing templates (offers, advertisements)
  • AUTHENTICATION - Authentication templates (verification codes)

Use Cases

1. Search for Specific Template

GET /templates?searchTerm=welcome&phone_number_id=123456

2. View Approved Templates Only

const templates = await getTemplates();
const approved = templates.data.filter(t => t.status === 'APPROVED');

3. Use Template in Message

See Send WhatsApp Template for complete details.


Error Codes

CodeDescriptionCauseSolution
404Not FoundTemplate not foundCheck template ID
400Bad RequestInvalid dataCheck sent data

Related Sections

Messages

Using templates in sending messages

View Guide
View

Authentication

Required request authentication

View Guide
View

Technical Support

Need help?

  • šŸ“§ Email: support@awalchat.com
  • šŸ’¬ Live Chat: Available in the dashboard
  • šŸ“± WhatsApp: Contact us directly via WhatsApp
  • šŸ“š Examples: Check Code Examples