Update Knowledge Base
curl --request PUT \
--url https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Knowledge Base Title",
"description": "Knowledge Base Description",
"retrain_frequency_minutes": 1440,
"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": "5f7b1b1b1b1b1b1b1b1b1b1b"
}
]
}
'import requests
url = "https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}"
payload = {
"title": "Knowledge Base Title",
"description": "Knowledge Base Description",
"retrain_frequency_minutes": 1440,
"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": "5f7b1b1b1b1b1b1b1b1b1b1b" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Knowledge Base Title',
description: 'Knowledge Base Description',
retrain_frequency_minutes: 1440,
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: '5f7b1b1b1b1b1b1b1b1b1b1b'}]
})
};
fetch('https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Knowledge Base Title',
'description' => 'Knowledge Base Description',
'retrain_frequency_minutes' => 1440,
'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' => '5f7b1b1b1b1b1b1b1b1b1b1b'
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"title\": \"Knowledge Base Title\",\n \"description\": \"Knowledge Base Description\",\n \"retrain_frequency_minutes\": 1440,\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\": \"5f7b1b1b1b1b1b1b1b1b1b1b\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Knowledge Base Title\",\n \"description\": \"Knowledge Base Description\",\n \"retrain_frequency_minutes\": 1440,\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\": \"5f7b1b1b1b1b1b1b1b1b1b1b\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Knowledge Base Title\",\n \"description\": \"Knowledge Base Description\",\n \"retrain_frequency_minutes\": 1440,\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\": \"5f7b1b1b1b1b1b1b1b1b1b1b\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "5f7b1b1b1b1b1b1b1b1b1b1b",
"title": "Knowledge Base Title",
"description": "Knowledge Base Description",
"status": "trained",
"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": "5f7b1b1b1b1b1b1b1b1b1b1b",
"name": "some_file.json",
"type": "file",
"createdAt": "2020-10-05T00:00:00.000Z",
"updatedAt": "2020-10-05T00:00:00.000Z"
}
]
}{
"detail": "Knowledge base not found"
}Knowledge Bases
Update Knowledge Base
Update Knowledge Base
PUT
/
kb
/
v1
/
knowledge-bases
/
{id}
Update Knowledge Base
curl --request PUT \
--url https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Knowledge Base Title",
"description": "Knowledge Base Description",
"retrain_frequency_minutes": 1440,
"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": "5f7b1b1b1b1b1b1b1b1b1b1b"
}
]
}
'import requests
url = "https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}"
payload = {
"title": "Knowledge Base Title",
"description": "Knowledge Base Description",
"retrain_frequency_minutes": 1440,
"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": "5f7b1b1b1b1b1b1b1b1b1b1b" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Knowledge Base Title',
description: 'Knowledge Base Description',
retrain_frequency_minutes: 1440,
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: '5f7b1b1b1b1b1b1b1b1b1b1b'}]
})
};
fetch('https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Knowledge Base Title',
'description' => 'Knowledge Base Description',
'retrain_frequency_minutes' => 1440,
'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' => '5f7b1b1b1b1b1b1b1b1b1b1b'
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"title\": \"Knowledge Base Title\",\n \"description\": \"Knowledge Base Description\",\n \"retrain_frequency_minutes\": 1440,\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\": \"5f7b1b1b1b1b1b1b1b1b1b1b\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Knowledge Base Title\",\n \"description\": \"Knowledge Base Description\",\n \"retrain_frequency_minutes\": 1440,\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\": \"5f7b1b1b1b1b1b1b1b1b1b1b\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Knowledge Base Title\",\n \"description\": \"Knowledge Base Description\",\n \"retrain_frequency_minutes\": 1440,\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\": \"5f7b1b1b1b1b1b1b1b1b1b1b\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "5f7b1b1b1b1b1b1b1b1b1b1b",
"title": "Knowledge Base Title",
"description": "Knowledge Base Description",
"status": "trained",
"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": "5f7b1b1b1b1b1b1b1b1b1b1b",
"name": "some_file.json",
"type": "file",
"createdAt": "2020-10-05T00:00:00.000Z",
"updatedAt": "2020-10-05T00:00:00.000Z"
}
]
}{
"detail": "Knowledge base not found"
}Authorizations
Retrieve your API Key from Dashboard API Keys Section.
Body
application/json
Response
Successful response