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

# Bot Export API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/automation/api-list)</Badge>

To export the bot definition and all associated components.

<Note>
  This API only initiates the export process. Use the [Export Status API](/ai-for-service/apis/automation/bot-export-status) to view the export progress and obtain a download link once the export completes.
</Note>

| 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](/ai-for-service/apis/automation/api-introduction/#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 theme={null}
curl --location 'https://{host}/api/public/bot/{BotID}/export' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'content-type: application/json' \
--data '{
    "exportType": "published",
    "exportOptions": {
        "settings": [
            "botSettings",
            "botVariables",
            "ivrSettings",
            "genAIandLLMSettings"
        ],
        "tasks": [
            "botTask",
            "knowledgeGraph",
            "smallTalk"
        ],
        "nlpData": [
            "utterances",
            "patterns",
            "traits",
            "rules",
            "concepts",
            "synonyms",
            "standardResponses",
            "nlpSettings"
        ],
        "AgentAI": [
            "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`, `AgentAI`, 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 |

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