> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zixflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get WhatsApp Template Variables

> Retrieves the variable keys and types for a specific WhatsApp template

#### 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

<ParamField header="x-api-key" type="string" required placeholder="Enter your API key">
  Your API key for authentication.
</ParamField>

<ParamField header="x-workspace-id" type="string" required placeholder="Enter your workspace ID">
  Your workspace ID for authentication.
</ParamField>

#### Path Parameters

<ParamField path="phone_id" type="string" required placeholder="Enter WhatsApp Phone ID">
  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.
</ParamField>

#### Query Parameters

<ParamField query="template_name" type="string" required placeholder="Enter template name">
  The name of the WhatsApp template for which you want to retrieve variable information.
</ParamField>

<ParamField query="language" type="string" required placeholder="Enter language code">
  The language code of the template (e.g., "en", "en\_US"). This must match the language of the template you want to query.
</ParamField>

#### Response

<ResponseField name="success" type="boolean">
  Indicates whether the API call was successful.
</ResponseField>

<ResponseField name="message" type="string">
  Success or error message from the API.
</ResponseField>

<ResponseField name="data" type="object">
  The template variables response containing:
</ResponseField>

<ResponseField name="data.data" type="array">
  An array of template variable objects, each containing:
</ResponseField>

<ResponseField name="data.data[].keyName" type="string">
  The variable key name that should be used when sending the template. This is the identifier you'll use in your API request.
</ResponseField>

<ResponseField name="data.data[].label" type="string">
  The display label for the variable, which provides a human-readable description of what the variable represents.
</ResponseField>

<ResponseField name="data.data[].type" type="string">
  The type of the variable. Possible values: "IMAGE\_URL", "VIDEO\_URL", "DOCUMENT\_URL", "TEXT", "OTP".
</ResponseField>

<ResponseExample>
  ```json 200-Success theme={null}
  {
    "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"
        }
      ]
    }
  }
  ```

  ```json 400-Bad Request theme={null}
  {
    "success": false,
    "message": "Invalid phone_id, template_name, or language parameter"
  }
  ```

  ```json 401-Unauthorized theme={null}
  {
    "success": false,
    "message": "Unauthorized. Please check your API key and workspace ID."
  }
  ```

  ```json 500-Internal Server Error theme={null}
  {
    "success": false,
    "message": "Internal server error. Please try again later."
  }
  ```
</ResponseExample>
