Skip to content

Import Bot as a New Bot API

To create a new bot in the account owner’s Builder Tool using the File IDs generated when uploading the files to the local server. You can import a bot using either individual Definition, Config, Functions and Icon files, or you can directly use the zip file that is creating while performing bot export. In this case you will need to upload the zip file and use the File ID thus generated.

Please refer to the Upload File API for uploading and obtaining the File Id.

Note

The API requires the JWT generated by an application created only from the Bot Admin Console.

Method POST
Endpoint https://{{host}}/api/public/bot/import
Content Type application/json
Authorization auth: {{JWT}}
See How to generate the JWT Token.
API Scope
  • Bot Builder: Not Applicable
  • Admin Console: Bot Definition > Bot Import

Query Parameters

PARAMETER DESCRIPTION MANDATE
host The environment URL. For example, https://platform.kore.ai Required

Sample Request

Case 1: JSON

curl -X POST \
  https://{{host}}/api/public/bot/import \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
   -H 'content-type: application/json' \
   -d '{
  "botDefinition" : "5bxxxxxxxxxxx4f9",
  "configInfo" : "5bxxxxxxxxxxxxx4fa",
  "botFunctions":["5bxxxxxxxxxxxxxea6"],
  "icon":"5bxxxxxxxxxxxxxxxx4fb"
  "name":"gallahad4",
  "uploadMode":"JSON"
}'

Case 2: ZIP file

curl -X POST \
  https://{{host}}/api/public/bot/import \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
   -H 'content-type: application/json' \
   -d '{
  "zipInfo" : "661e717ffad890b38442ea39",
  "name":"volkihar",
  "uploadMode":"ZIP"
}'

Body Parameters

PARAMETER DESCRIPTION MANDATE
uploadMode “Mode of Upload (JSON/ZIP)” Required
botDefinition “Bot definition file id” Required (If uploadMode is **JSON**)
configInfo “Bot configuration file id” Required (If uploadMode is **JSON**)
botFunctions “Bot functions File id” Optional (If uploadMode is **JSON**)
icon “Bot icon File id” Required (If uploadMode is **JSON**)
zipInfo “Zip file id” Required (If uploadMode is **ZIP**)
name “Bot name”
– If not provided, it is fetched from the existing bot’s copy.
Optional
purpose “customer”/”employee”
– If not provided, it is fetched from the existing bot’s copy.
Optional

Sample Response

{
    "_id": "bir-034fc180-4f84-5c54-a963-5d85b76a36dc",
    "streamRefId": "46d82741-1edc-536b-92aa-7e58ead9deed",
    "status": "pending",
    "statusLogs": [
        {
            "taskType": "importRequest",
            "taskName": "volkihar",
            "status": "success"
        }
    ],
    "requestType": "Botimport",
    "createdBy": "u-ed453f8f-131a-5d6f-86fe-03405203199d",
    "createdOn": "2024-04-29T11:09:25.312Z",
    "__v": 0
}