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

# Extraction from File or URL - KG

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

Extracts the Knowledge Graph from an imported file or URL.

| Property | Value |
| - | - |
| **Method** | POST |
| **Endpoint** | `https://{{host}}/api/public/bot/{{botId}}/qna/import?language=en` |
| **Content Type** | `application/json` |
| **Authorization** | `auth: {{YOUR_JWT_ACCESS_TOKEN}}` — 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: Manage Knowledge Graph; Admin Console: Manage Knowledge Graph |

## Path Parameters

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

## Query Parameters

| Parameter | Required | Description |
| - | - | - |
| `language` | Required | The bot language code. For example, `en` for English and `de` for German. |

## Sample Request (Extraction using URL)

```bash theme={null}
curl --location 'https://{{host}}/api/public/bot/{{streamId}}/qna/import?language=en' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'content-type: application/json' \
--data '{
    "fileUrl": "https://www.example.com/nri-banking/money_transfer/faq/loyalty-program.page",
    "name": "Test"
}'
```

## Sample Request (Extraction using File)

```bash theme={null}
curl --location 'https://{{host}}/api/public/bot/{{streamId}}/qna/import?language=en' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'content-type: application/json' \
--data '{
    "fileId": "64c0facd1913a83c147xxxxx",
    "name": "Test2"
}'
```

## Body Parameters

| Parameter | Required | Description |
| - | - | - |
| `fileUrl` | Required | The URL pointing to the location of the FAQs to extract. |
| `fileId` | Required | The file ID pointing to the FAQ file's location. |
| `name` | Required | The name to assign to the FAQ. |

## Sample Response

```json theme={null}
{
    "_id": "<extractionId>",
    "status": "success"
}
```


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