POST
WhatsappTemplates.Add
Create a WhatsApp template. The required fields are name, language, message, and dynamic_variables. Dynamic variables map the WhatsApp placeholders {{1}}, {{2}}, etc. to customer/system fields used when the template is sent.
Permissions
- User must be logged in with a valid bearer token.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
Adds a row to the WhatsApp templates settings table for this organization. Dynamic variables are stored in the format used by the WhatsApp sender.
Push Service
Pushes whatsapptemplates.created to the current user/owner so connected settings UIs can refresh their template list.
Automation
No automation is run for this function.
Special Instructions
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- Send parameters as POST body fields exactly as documented.
- Send date/time values in UTC Y-m-d H:i:s format when a date or datetime field is used.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
namepost | string | welcome_customer | Template name shown in Biz1 and used by automations/campaigns. Stored as template_name. |
languagepost | string | he | Template language code, for example he, en, ar, ru. |
messagepost | string | Hello {{1}}, thank you for contacting us | Template message text. Use WhatsApp placeholders like {{1}} for variables. |
dynamic_variablespost | json array | ["name"] | Variables for {{1}}, {{2}}, etc. Send an array such as ["name","phone"]. The system stores it in the WhatsApp dynamic key format. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
namespacepost | string | project_or_namespace | Provider namespace/project id. Alias of whatsapp_template_namespace. |
bird_template_versionpost | string | v1 | MessageBird/Bird template version when needed by the provider. |
media_urlpost | url | https://files.biz1.co.il/file.pdf | Optional media file URL already uploaded to the files server. This route does not upload files. |
button_url_variablespost | json array | ["document_link"] | Dynamic variables for template button URLs. |
approvedpost | int | 0 | Provider approval status. Defaults to 0. |
show_statuspost | int | 1 | 1 visible/active, 0 hidden. Defaults to 1. |
templates_for_customerpost | int | 1 | Allow this template for customer communication. Defaults to 1. |
use_to_send_documentspost | int | 1 | Allow this template for document sending. |
documents_orderpost | int | 1 | Allow for purchase/order documents. |
documents_tax_invoicespost | int | 1 | Allow for tax invoices. |
documents_recieptpost | int | 1 | Allow for receipts. |
documents_detail_orderpost | int | 1 | Allow for detail orders. |
documents_newspaper_orderpost | int | 1 | Allow for newspaper orders. |
documents_credit_invoicespost | int | 1 | Allow for credit invoices. |
documents_proforma_invoicespost | int | 1 | Allow for proforma invoices. |
documents_deliverypost | int | 1 | Allow for delivery documents. |
documents_receipts_tax_invoicespost | int | 1 | Allow for receipt tax invoices. |
documents_gr_irpost | int | 1 | Allow for GR/IR invoices. |
documents_quotepost | int | 1 | Allow for quotes/proposals. |
documents_donation_receiptpost | int | 1 | Allow for donation receipts. |
dynamic_contentpost | int | 0 | Enable dynamic content handling when the provider/template supports it. |
providerpost | string | bird | WhatsApp provider. Alias of whatsApp_provider. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/WhatsappTemplates.Add",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"name": "welcome_customer",
"language": "he",
"message": "Hello {{1}}",
"dynamic_variables": "[\"name\"]"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/WhatsappTemplates.Add",
"url_domain": "https:\/\/{domain}\/app\/WhatsappTemplates.Add"
}Endpoint
POST /app/WhatsappTemplates.Add
POST https://{user}.bull36.com/app/WhatsappTemplates.Add
POST https://{domain}/app/WhatsappTemplates.AddSample Output
{
"success": 1,
"id": 12,
"message": "Record added successfully.",
"automation_event": null,
"socket_event": "whatsapptemplates.created"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({
name: 'welcome_customer',
language: 'he',
message: 'Hello {{1}}',
dynamic_variables: JSON.stringify(['name'])
});
const res = await fetch('/app/WhatsappTemplates.Add', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": "0",
"message": "Missing required parameter: name, language, message, dynamic_variables"
}