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

NameTypeSampleExplanation
name
post
stringwelcome_customerTemplate name shown in Biz1 and used by automations/campaigns. Stored as template_name.
language
post
stringheTemplate language code, for example he, en, ar, ru.
message
post
stringHello {{1}}, thank you for contacting usTemplate message text. Use WhatsApp placeholders like {{1}} for variables.
dynamic_variables
post
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

NameTypeSampleWhat it gives
namespace
post
stringproject_or_namespaceProvider namespace/project id. Alias of whatsapp_template_namespace.
bird_template_version
post
stringv1MessageBird/Bird template version when needed by the provider.
media_url
post
urlhttps://files.biz1.co.il/file.pdfOptional media file URL already uploaded to the files server. This route does not upload files.
button_url_variables
post
json array["document_link"]Dynamic variables for template button URLs.
approved
post
int0Provider approval status. Defaults to 0.
show_status
post
int11 visible/active, 0 hidden. Defaults to 1.
templates_for_customer
post
int1Allow this template for customer communication. Defaults to 1.
use_to_send_documents
post
int1Allow this template for document sending.
documents_order
post
int1Allow for purchase/order documents.
documents_tax_invoices
post
int1Allow for tax invoices.
documents_reciept
post
int1Allow for receipts.
documents_detail_order
post
int1Allow for detail orders.
documents_newspaper_order
post
int1Allow for newspaper orders.
documents_credit_invoices
post
int1Allow for credit invoices.
documents_proforma_invoices
post
int1Allow for proforma invoices.
documents_delivery
post
int1Allow for delivery documents.
documents_receipts_tax_invoices
post
int1Allow for receipt tax invoices.
documents_gr_ir
post
int1Allow for GR/IR invoices.
documents_quote
post
int1Allow for quotes/proposals.
documents_donation_receipt
post
int1Allow for donation receipts.
dynamic_content
post
int0Enable dynamic content handling when the provider/template supports it.
provider
post
stringbirdWhatsApp 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.Add

Sample 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"
}