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

# Bot Variables Import API

[Back to API List](https://koreai.mintlify.site/ai-for-service/apis/automation/api-list)

Import environment and content (locale) variables into a bot.

| Field | Value |
| - | - |
| **Method** | POST |
| **Endpoint** | `https://{{host}}/api/{{version}}/public/builder/bot/{{botId}}/variables/import` |
| **Content Type** | `application/json` |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token](https://koreai.mintlify.site/ai-for-service/apis/automation/api-introduction.md#generating-the-jwt-token). |
| **API Scope** | App Builder: Import Variables; Admin Console: Not Applicable |

## Path Parameters

| Parameter | Required | Description |
| - | - | - |
| `host` | Required | The environment URL, for example: `https://platform.kore.ai`. |
| `botId/streamId` | Required | App ID or Bot ID. Access it via **App Settings** → **App Profile**. |
| `version` | Required | API version, for example: `1.1`. |

## Sample Request

```json expandable=true theme={null}
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

| Parameter | Required | Description |
| - | - | - |
| `key` | Required | Name of the variable. |
| `value` | Required | Value for the variable. |
| `hint` | Required | Description of the variable. |
| `variableType` | Required | Type of the variable: `env` (Environment/Global variable) or `locale` (Content variable). |
| `scope` | Required | Scope of the variable: `prePopulated`, `askOnInstall`, or `hidden`. |
| `localeData` | Required (for locale type) | Applicable only when `variableType = locale`. Contains language-specific data. |
| `localeData.localeCode` | Required (for locale type) | Locale identifier, for example `en`, `fr`, `ja`. |
| `localeData.localeCode.hint` | Optional | Optional hint for the localized value. |
| `localeData.localeCode.value` | Required (for locale type) | Localized message or text for the locale. |

## Sample Request When Collections Are Enabled

```json expandable=true theme={null}
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"
        }
    ]
}'
```

> [!NOTE]
>
> The `botCollections` and `botCollectionVariables` fields are required only when importing bot collection variables.

### Body Parameters (Collections)

| Parameter | Type | Description | |
| - | - | - | - |
| `botVariables` | array | List of bot-level variables to create or import. | |
| `ignoreEnvironmentVariables` | boolean | Set to `true` to exclude environment variables during import. | Optional |
| `ignoreContentVariables` | boolean | Set to `true` to exclude content variables during import. | Optional |
| `botCollections` | array | Required only when importing bot collection variables. Defines available bot collections. | |
| `botCollections.name` | string | Name of the bot collection. | |
| `botCollections.description` | string | Description of the bot collection. | |
| `botCollections.refId` | string | Unique identifier of the bot collection. | |
| `botCollectionVariables` | array | Required only when importing bot collection variables. Defines collection-specific variable values. | |
| `botCollectionVariables.key` | string | Name of the variable within the bot collection. | |
| `botCollectionVariables.value` | string | Value assigned to the variable for the specified collection. | |
| `botCollectionVariables.refId` | string | Reference ID of the bot collection. | |

## Sample Response

```json theme={null}
{
  "message": "2 Variables imported/updated successfully."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.