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

# Upload File API

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

To upload the botdefinition, botconfig, and botfunction files (if any) and the **bot** icon to the local server. You can also use this API to upload files for ingestion using Search AI. The API returns the file ID in response which is required in the Import Bot API or Ingest Data API for further actions on the file.

<Note>
  To upload botdefinition, botconfig, and botfunction files, you need to upload the files separately. You can upload a file by signing with any app created by the account administrator.
</Note>

| Field             | Value                                                                                                                           |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | POST                                                                                                                            |
| **Endpoint**      | `https://{{host}}/api/public/uploadfile`                                                                                        |
| **Content Type**  | `multipart/form-data`                                                                                                           |
| **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: Not Applicable                                                                      |

## Query Parameters

| Parameter | Description                                                  | Required |
| --------- | ------------------------------------------------------------ | -------- |
| `host`    | The environment URL. For example, `https://platform.kore.ai` | Required |

## Sample Request

```bash theme={null}
curl -X POST 'https://{{host}}/api/public/uploadfile' \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
  -H 'content-type: multipart/form-data' \
  -F file=@botDefinition.json \
  -F fileContext=bulkImport \
  -F fileExtension=json
```

## Body Parameters

The following parameters are **required** and passed based on the file type:

**For Bot Definition File ID:**

| Parameter       | Description                         |
| --------------- | ----------------------------------- |
| `file`          | Upload the Botdefinition.json file. |
| `fileContext`   | `bulkImport`                        |
| `fileExtension` | `.json`                             |

**For Bot Config File ID:**

| Parameter       | Description                     |
| --------------- | ------------------------------- |
| `file`          | Upload the Botconfig.json file. |
| `fileContext`   | `bulkImport`                    |
| `fileExtension` | `.json`                         |

**For Bot Function File ID:**

| Parameter       | Description                   |
| --------------- | ----------------------------- |
| `file`          | Upload the Bot function file. |
| `fileContext`   | `bulkImport`                  |
| `fileExtension` | `.js`                         |

**For Bot Icon File ID:**

| Parameter       | Description               |
| --------------- | ------------------------- |
| `file`          | Upload the Bot icon file. |
| `fileContext`   | `bulkImport`              |
| `fileExtension` | `.json`                   |

**For ML Utterances File ID:**

| Parameter       | Description                                       |
| --------------- | ------------------------------------------------- |
| `file`          | Upload the ML Utterance file (`.json` or `.csv`). |
| `fileContext`   | `bulkImport`                                      |
| `fileExtension` | `.json` or `.csv`                                 |

**For Data Ingestion in Search AI:**

| Parameter       | Description                                                    |
| --------------- | -------------------------------------------------------------- |
| `file`          | Upload the file to be ingested into the Search AI application. |
| `fileContext`   | `findly`                                                       |
| `fileExtension` | `pdf`, `docx`, `txt`, `pptx`                                   |
