API
Log in
Documentation › Messages › Create Meta template
POST

Create Meta template

POSThttps://app.sendapp.ai/api/whatsapp-meta/create_template
Creates a WhatsApp Meta template and submits it to Meta for approval. Pass the simple fields (body, and the optional header/footer) and we build the components for you; for advanced templates you can pass the components array directly in Meta format. In the body use {{1}}, {{2}}… as variables.
The template must be approved by Meta before it can be sent. Approval may take some time.
Parameters
apikey required
Your API Key.
token required
WhatsApp Meta account token.
name required
Template name: lowercase, letters, numbers and underscores only.
category required
MARKETING, UTILITY or AUTHENTICATION.
body required
Body text (required if you do not pass components).
language optional
Language code (default it).
header optional
Header text (max 60 characters).
footer optional
Footer text (max 60 characters).
components optional
Array/JSON of components in Meta format, for advanced templates.
Request
curl -X POST 'https://app.sendapp.ai/api/whatsapp-meta/create_template' \
  -H 'Content-Type: application/json' \
  -d '{
    "apikey": "YOUR_API_KEY",
    "token": "YOUR_ACCOUNT_TOKEN",
    "name": "promo_estate",
    "category": "MARKETING",
    "language": "it",
    "header": "Special offer",
    "body": "Hi {{1}}, {{2}}% off today only!",
    "footer": "Reply STOP to unsubscribe"
  }'
<?php
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-meta/create_template');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'apikey'   => 'YOUR_API_KEY',
        'token'    => 'YOUR_ACCOUNT_TOKEN',
        'name'     => 'promo_estate',
        'category' => 'MARKETING',
        'body'     => 'Hi {{1}}, {{2}}% off today only!',
    ]),
]);
echo curl_exec($ch);
const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/create_template', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    apikey: 'YOUR_API_KEY',
    token: 'YOUR_ACCOUNT_TOKEN',
    name: 'promo_estate',
    category: 'MARKETING',
    body: 'Hi {{1}}, {{2}}% off today only!'
  })
});
console.log(await res.json());
Response (200 OK)
{
  "status": "success",
  "message": "Template created successfully.",
  "template_id": "1234567890123456"
}
Error
{
  "status": "error",
  "message": "The name can only contain lowercase letters, numbers and underscores."
}