Skip to main content
GET
https://api-ai.zixflow.com
/
api
/
data
/
whatsapp
/
v1
/
{phone_id}
/
variable-keys
Get WhatsApp Template Variables
curl --request GET \
  --url https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/variable-keys \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-workspace-id: <x-workspace-id>'
{
  "success": true,
  "message": "Template variables retrieved successfully",
  "data": {
    "data": [
      {
        "keyName": "customer_name",
        "label": "Customer Name",
        "type": "TEXT"
      },
      {
        "keyName": "order_number",
        "label": "Order Number",
        "type": "TEXT"
      },
      {
        "keyName": "product_image",
        "label": "Product Image",
        "type": "IMAGE_URL"
      },
      {
        "keyName": "otp_code",
        "label": "OTP Code",
        "type": "OTP"
      }
    ]
  }
}

Description

This endpoint allows you to retrieve the variable keys and their types for a specific WhatsApp template. This is useful when you need to know what variables are required or available in a template before sending a message. Each variable includes its key name, type, and display label.

Headers

x-api-key
string
required
Your API key for authentication.
x-workspace-id
string
required
Your workspace ID for authentication.

Path Parameters

phone_id
string
required
The unique Phone ID associated with your WhatsApp Business account. You can find this on the Zixflow WhatsApp Settings page or by calling the Get WhatsApp Accounts endpoint.

Query Parameters

template_name
string
required
The name of the WhatsApp template for which you want to retrieve variable information.
language
string
required
The language code of the template (e.g., “en”, “en_US”). This must match the language of the template you want to query.

Response

success
boolean
Indicates whether the API call was successful.
message
string
Success or error message from the API.
data
object
The template variables response containing:
data.data
array
An array of template variable objects, each containing:
data.data[].keyName
string
The variable key name that should be used when sending the template. This is the identifier you’ll use in your API request.
data.data[].label
string
The display label for the variable, which provides a human-readable description of what the variable represents.
data.data[].type
string
The type of the variable. Possible values: “IMAGE_URL”, “VIDEO_URL”, “DOCUMENT_URL”, “TEXT”, “OTP”.
{
  "success": true,
  "message": "Template variables retrieved successfully",
  "data": {
    "data": [
      {
        "keyName": "customer_name",
        "label": "Customer Name",
        "type": "TEXT"
      },
      {
        "keyName": "order_number",
        "label": "Order Number",
        "type": "TEXT"
      },
      {
        "keyName": "product_image",
        "label": "Product Image",
        "type": "IMAGE_URL"
      },
      {
        "keyName": "otp_code",
        "label": "OTP Code",
        "type": "OTP"
      }
    ]
  }
}