Create Knowledge Base
curl --request POST \
--url https://api-prod.interactly.ai/kb/v1/knowledge-bases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "My Knowledge Base",
"description": "<string>",
"docs": [
{
"type": "url",
"payload": {
"urls_to_include": [
{
"url": "<string>",
"subpaths_only": false,
"recursive": false
}
],
"urls_to_exclude": [
{
"url": "<string>",
"subpaths_only": false,
"recursive": false
}
]
}
}
],
"files": [
{
"id": "<string>"
}
],
"retrain_frequency_minutes": 0
}
'import requests
url = "https://api-prod.interactly.ai/kb/v1/knowledge-bases"
payload = {
"title": "My Knowledge Base",
"description": "<string>",
"docs": [
{
"type": "url",
"payload": {
"urls_to_include": [
{
"url": "<string>",
"subpaths_only": False,
"recursive": False
}
],
"urls_to_exclude": [
{
"url": "<string>",
"subpaths_only": False,
"recursive": False
}
]
}
}
],
"files": [{ "id": "<string>" }],
"retrain_frequency_minutes": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'My Knowledge Base',
description: '<string>',
docs: [
{
type: 'url',
payload: {
urls_to_include: [{url: '<string>', subpaths_only: false, recursive: false}],
urls_to_exclude: [{url: '<string>', subpaths_only: false, recursive: false}]
}
}
],
files: [{id: '<string>'}],
retrain_frequency_minutes: 0
})
};
fetch('https://api-prod.interactly.ai/kb/v1/knowledge-bases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.interactly.ai/kb/v1/knowledge-bases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'My Knowledge Base',
'description' => '<string>',
'docs' => [
[
'type' => 'url',
'payload' => [
'urls_to_include' => [
[
'url' => '<string>',
'subpaths_only' => false,
'recursive' => false
]
],
'urls_to_exclude' => [
[
'url' => '<string>',
'subpaths_only' => false,
'recursive' => false
]
]
]
]
],
'files' => [
[
'id' => '<string>'
]
],
'retrain_frequency_minutes' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-prod.interactly.ai/kb/v1/knowledge-bases"
payload := strings.NewReader("{\n \"title\": \"My Knowledge Base\",\n \"description\": \"<string>\",\n \"docs\": [\n {\n \"type\": \"url\",\n \"payload\": {\n \"urls_to_include\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ],\n \"urls_to_exclude\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ]\n }\n }\n ],\n \"files\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"retrain_frequency_minutes\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-prod.interactly.ai/kb/v1/knowledge-bases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My Knowledge Base\",\n \"description\": \"<string>\",\n \"docs\": [\n {\n \"type\": \"url\",\n \"payload\": {\n \"urls_to_include\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ],\n \"urls_to_exclude\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ]\n }\n }\n ],\n \"files\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"retrain_frequency_minutes\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/kb/v1/knowledge-bases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"My Knowledge Base\",\n \"description\": \"<string>\",\n \"docs\": [\n {\n \"type\": \"url\",\n \"payload\": {\n \"urls_to_include\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ],\n \"urls_to_exclude\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ]\n }\n }\n ],\n \"files\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"retrain_frequency_minutes\": 0\n}"
response = http.request(request)
puts response.read_bodyKnowledge Bases
Create Knowledge Base
Create Knowledge Base
POST
/
kb
/
v1
/
knowledge-bases
Create Knowledge Base
curl --request POST \
--url https://api-prod.interactly.ai/kb/v1/knowledge-bases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "My Knowledge Base",
"description": "<string>",
"docs": [
{
"type": "url",
"payload": {
"urls_to_include": [
{
"url": "<string>",
"subpaths_only": false,
"recursive": false
}
],
"urls_to_exclude": [
{
"url": "<string>",
"subpaths_only": false,
"recursive": false
}
]
}
}
],
"files": [
{
"id": "<string>"
}
],
"retrain_frequency_minutes": 0
}
'import requests
url = "https://api-prod.interactly.ai/kb/v1/knowledge-bases"
payload = {
"title": "My Knowledge Base",
"description": "<string>",
"docs": [
{
"type": "url",
"payload": {
"urls_to_include": [
{
"url": "<string>",
"subpaths_only": False,
"recursive": False
}
],
"urls_to_exclude": [
{
"url": "<string>",
"subpaths_only": False,
"recursive": False
}
]
}
}
],
"files": [{ "id": "<string>" }],
"retrain_frequency_minutes": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'My Knowledge Base',
description: '<string>',
docs: [
{
type: 'url',
payload: {
urls_to_include: [{url: '<string>', subpaths_only: false, recursive: false}],
urls_to_exclude: [{url: '<string>', subpaths_only: false, recursive: false}]
}
}
],
files: [{id: '<string>'}],
retrain_frequency_minutes: 0
})
};
fetch('https://api-prod.interactly.ai/kb/v1/knowledge-bases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.interactly.ai/kb/v1/knowledge-bases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'My Knowledge Base',
'description' => '<string>',
'docs' => [
[
'type' => 'url',
'payload' => [
'urls_to_include' => [
[
'url' => '<string>',
'subpaths_only' => false,
'recursive' => false
]
],
'urls_to_exclude' => [
[
'url' => '<string>',
'subpaths_only' => false,
'recursive' => false
]
]
]
]
],
'files' => [
[
'id' => '<string>'
]
],
'retrain_frequency_minutes' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-prod.interactly.ai/kb/v1/knowledge-bases"
payload := strings.NewReader("{\n \"title\": \"My Knowledge Base\",\n \"description\": \"<string>\",\n \"docs\": [\n {\n \"type\": \"url\",\n \"payload\": {\n \"urls_to_include\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ],\n \"urls_to_exclude\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ]\n }\n }\n ],\n \"files\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"retrain_frequency_minutes\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-prod.interactly.ai/kb/v1/knowledge-bases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My Knowledge Base\",\n \"description\": \"<string>\",\n \"docs\": [\n {\n \"type\": \"url\",\n \"payload\": {\n \"urls_to_include\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ],\n \"urls_to_exclude\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ]\n }\n }\n ],\n \"files\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"retrain_frequency_minutes\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/kb/v1/knowledge-bases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"My Knowledge Base\",\n \"description\": \"<string>\",\n \"docs\": [\n {\n \"type\": \"url\",\n \"payload\": {\n \"urls_to_include\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ],\n \"urls_to_exclude\": [\n {\n \"url\": \"<string>\",\n \"subpaths_only\": false,\n \"recursive\": false\n }\n ]\n }\n }\n ],\n \"files\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"retrain_frequency_minutes\": 0\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Retrieve your API Key from Dashboard API Keys Section.
Body
application/json
A descriptive and human-readable name for the knowledge base
Example:
"My Knowledge Base"
Here you can upload URLs
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Automatic retrain interval in minutes. Set retrain_frequency_minutes = 0 to disable automatic retraining. Allowed values: multiples of 60
Example:
0
Response
201
Knowledge Base created successfully
⌘I