Create Variables API

Overview

The Create API allows you to define variables with valid names, types, and default values.

Endpoint

Here is a sample endpoint from the account in the India region:
https://in1.api.clevertap.com/1/createVars

Authentication

Authentication is required using accountId and passcode headers.

Headers

Refer to Headers for more details.

Region

Refer to Regions to view region-specific sample endpoints

HTTP Method

The HTTP method is POST for the Create Variables API.

Body Parameters

ObjectParameterDescriptionTypeRequired/Optional
variableDefinitionstypeThe type of the VariableString, Boolean, NumberRequired
descriptionThe description of the VariableStringOptional
defaultValueThe default value of the variableString, Boolean, NumberRequired
{
  "variableDefinitions": {
    "variableName": {
      "type": string ("string", "boolean", "number"),
      "description": string ("New Variable used for controlling XYZ"),
      "defaultValue": (type depends on the type)
    },
    
    }
  }

Sample Request

curl -X POST -d '{"variableNAmes":["var1","folder1.var2"]}' "https://in1.api.clevertap.com/1/deleteVars" \
-H "X-CleverTap-Account-Id: ACCOUNT_ID" \
-H "X-CleverTap-Passcode: PASSCODE" \
-H "Content-Type: application/json; charset=utf-8"

Sample Response

{
    "status": "success",
    "warning": ""
}


πŸ“˜

Note

Newly defined Variables need to be Published from the Dashboard in order for it to persist.