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

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

To export the bot definition and all associated components.

> [!NOTE]
>
> This API only initiates the export process. Use the [Export Status API](https://koreai.mintlify.site/ai-for-service/apis/automation/bot-export-status) to view the export progress and obtain a download link once the export completes.

| Field | Value |
| - | - |
| **Method** | POST |
| **Endpoint** | `https://{{host}}/api/public/bot/{{BotID}}/export` |
| **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: Bot Export; Admin Console: Bot Definition > Bot Export |

## Query Parameters

| Parameter | Description | Required |
| - | - | - |
| `host` | The environment URL. For example, `https://platform.kore.ai`. | Required |
| `BotID` | Bot ID or Stream ID. Access it under **General Settings** on the App Builder. | Required |

## Sample Request

```json expandable=true theme={null}
curl --location 'https://{host}/api/public/bot/{BotID}/export' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'content-type: application/json' \
--data '{
    "exportType": "latest",
    "exportOptions": {
        "settings": [
            "botSettings",
            "botVariables",
            "ivrSettings",
            "genAIandLLMSettings"
   ],


    "options" :{
 "botVariables":{                                                                                                              
                  "ignore": ["aa","test1"],
                  "ignoreEnvironmentVariables": false,
                  "ignoreContentVariables": true
              }
    },
        "tasks": [
            "botTask",
            "knowledgeGraph",
            "smallTalk"
        ],
        "nlpData": [
            "utterances",
            "patterns",
            "traits",
            "rules",
            "concepts",
            "synonyms",
            "standardResponses",
            "nlpSettings"
        ],
        "AgentAssist": [
            "rules",
            "playbooks",
            "widgetSettings",
            "layoutSettings"
        ]
    },
    "subTasks": {
        "alerts": [],
        "actions": [],
        "dialogs": [],
        "experienceFlows": []
    },
    "allTasks": true,
    "customDashboards": true,
    "IncludeDependentTasks": true
}'
```

## Body Parameters

| Parameter | Description | Required |
| - | - | - |
| `exportType` | Bot type: `latest` or `published`. | Required |
| `exportOptions` | All bot components are exported by default. Specify components to include if a partial export is needed. Supports `tasks`, `nlpData`, `AgentAssist`, and `settings` sub-keys. | Optional |
| `subTasks` | For partial export, list the specific tasks to include: `dialogs`, `alerts`, `actions`. | Optional |
| `IncludeDependentTasks` | Set to `true` to include dependent tasks in the export. | Optional |
| `customDashboards` | Set to `true` to include custom dashboards in the export. | Optional |
| `allTasks` | Set to `true` to include all tasks. Ignored if `subTasks` is present. | Optional |
| `botVariables` | Represents the environment variables. | Optional |
| `ignoreEnvironmentVariables` | Set to `true` to exclude environment variables during export. | Optional |
| `ignoreContentVariables` | Set to `true` to exclude content variables during export. | Optional |

## Sample Response

```json theme={null}
{
    "_id": "ber-a59b2599-xxxx-xxxx-a3ad-3109e08e427a",
    "streamId": "st-6fa10d24-xxxx-xxxx-b457-1e33a82b115e",
    "status": "pending",
    "createdBy": "u-ccdc35ab-xxxx-5xxxx-bd74-df7ae1afcfe6",
    "exportType": "latest",
    "requestType": "Botexport",
    "createdOn": "2024-09-30T08:12:03.442Z",
    "__v": 0
}
```


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