Skip to main content
Back to API List Import environment and content (locale) variables into a bot.
FieldValue
MethodPOST
Endpointhttps://{{host}}/api/{{version}}/public/builder/bot/{{botId}}/variables/import
Content Typeapplication/json
Authorizationauth: {{JWT}} See How to generate the JWT Token.
API ScopeApp Builder: Import Variables; Admin Console: Not Applicable

Path Parameters

ParameterRequiredDescription
hostRequiredThe environment URL, for example: https://platform.kore.ai.
botId/streamIdRequiredApp ID or Bot ID. Access it via App SettingsApp Profile.
versionRequiredAPI version, for example: 1.1.

Sample Request

curl --location 'https://{{host}}/api/1.1/public/builder/bot/{{botId}}/variables/import' \
--header 'Content-Type: application/json' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--data '[
   {
       "key": "Global",
       "value": "Globalkey-prePopulated",
       "hint": "",
       "variableType": "env",
       "scope": "prePopulated"
   },
   {
       "key": "Lang",
       "variableType": "locale",
       "scope": "prePopulated",
       "localeData": {
         "en": {
           "value": "english language prompt",
           "hint": ""
         }
       }
   }
]'

Body Parameters

ParameterRequiredDescription
keyRequiredName of the variable.
valueRequiredValue for the variable.
hintRequiredDescription of the variable.
variableTypeRequiredType of the variable: env (Environment/Global variable) or locale (Content variable).
scopeRequiredScope of the variable: prePopulated, askOnInstall, or hidden.
localeDataRequired (for locale type)Applicable only when variableType = locale. Contains language-specific data.
localeData.localeCodeRequired (for locale type)Locale identifier, for example en, fr, ja.
localeData.localeCode.hintOptionalOptional hint for the localized value.
localeData.localeCode.valueRequired (for locale type)Localized message or text for the locale.

Sample Request When Collections Are Enabled

curl -X POST \
  https://{{host}}/api/1.1/public/builder/bot/{{botId}}/variables/import \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "botVariables": [
        {
            "key": "CVar",
            "value": "Cvar1",
            "variableType": "locale",
            "scope": "prePopulated",
            "localeData": {
                "en": {
                    "value": "Cvar1",
                    "hint": ""
                }
            }
        }
    ],
    "botCollections": [
        {
            "name": "Default",
            "description": "Default Collection",
            "refId": "8xxxxxxa-exxc-5xx1-bxxd-56xxxxxxxxxx"
        }
    ],
    "botCollectionVariables": [
        {
            "key": "GKey1",
            "value": "GValue1-C",
            "refId": "8xxxxxxa-exxc-5xx1-bxxd-56xxxxxxxxxx"
        }
    ]
}'
The botCollections and botCollectionVariables fields are required only when importing bot collection variables.

Body Parameters (Collections)

ParameterTypeDescription
botVariablesarrayList of bot-level variables to create or import.
botCollectionsarrayRequired only when importing bot collection variables. Defines available bot collections.
botCollections.namestringName of the bot collection.
botCollections.descriptionstringDescription of the bot collection.
botCollections.refIdstringUnique identifier of the bot collection.
botCollectionVariablesarrayRequired only when importing bot collection variables. Defines collection-specific variable values.
botCollectionVariables.keystringName of the variable within the bot collection.
botCollectionVariables.valuestringValue assigned to the variable for the specified collection.
botCollectionVariables.refIdstringReference ID of the bot collection.

Sample Response

{
  "message": "2 Variables imported/updated successfully."
}