> ## 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.

# Publish Bot API

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

To initiate a publish request for a bot.

<Note>
  Before calling the API, ensure that at least one channel is enabled for the bot.
</Note>

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

## Path Parameters

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

## Sample Request

```json theme={null}
curl -X POST 'https://{{host}}/api/public/bot/{{BotID}}/publish' \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
    "versionComment" : "new update",
    "initiateTraining": true
}'
```

## Body Parameters

| Parameter          | Required | Description                                                                                                                                                                                                                                                                                                         |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `versionComment`   | Required | Comments for your Publish request.                                                                                                                                                                                                                                                                                  |
| `initiateTraining` | Optional | Indicates whether to trigger or skip the training process when publishing the bot: `true` to initiate the training; `false` to skip the training. By default, the platform automatically initiates training upon bot publishing. Skipping the training can result in issues in intent detection and flow execution. |

## Sample Response

```json theme={null}
[
    {
        "resourceType": "dialog",
        "resourceId": "dg-606c7f53-e94a-xxxx-xxxx-d83ce03e6360",
        "sbResourceId": "dg-606c7f53-e94a-xxxxf-xxxx-d83ce03e6360",
        "status": "SUCCESS",
        "result": {
            "state": "awaitingApproval",
            "approvalRequestedLanguages": [
                "en"
            ],
            "versionComment": "new update",
            "publishedOn": "2018-12-05T07:53:13.237Z",
            "name": "mortgage"
        }
    },
    {
        "resourceType": "NL",
        "status": "SUCCESS",
        "result": {
            "resourceId": "NL",
            "resourceType": "NL",
            "modules": [
                "nl_model",
                "settings"
            ],
            "name": "Natural Language"
        }
    },
    {
        "resourceType": "CHANNELS",
        "status": "SUCCESS",
        "result": {
            "resourceId": "CHANNELS",
            "resourceType": "CHANNELS",
            "modules": [
                "alexa"
            ],
            "name": "Channels"
        }
    },
    {
        "resourceType": "EXTENSIONS",
        "status": "SUCCESS",
        "result": {
            "resourceId": "EXTENSIONS",
            "resourceType": "EXTENSIONS",
            "modules": [
                "botkit",
                "agent_transfer",
                "websdk",
                "events"
            ],
            "name": "Extensions"
        }
    },
    {
        "resourceType": "SETTINGS",
        "status": "SUCCESS",
        "result": {
            "resourceId": "SETTINGS",
            "resourceType": "SETTINGS",
            "modules": [
                "general",
                "bot_variables",
                "pii",
                "ivr",
                "hold_resume",
                "custom_script",
                "advanced"
            ],
            "name": "Settings"
        }
    }
]
```
