curl --request POST \
--url https://api.elemente.ai/api/v1/knowledgebase \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "How to reset my password",
"type": "faq",
"agentIds": [
"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a",
"97e07544-bf7a-4af6-864c-07736fffb5c2"
],
"title": "How to reset my password",
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
"description": "This is a knowledge base",
"urls": [
"https://example.com/knowledge-base"
],
"refreshFrequency": "manual"
}
EOFimport requests
url = "https://api.elemente.ai/api/v1/knowledgebase"
payload = {
"name": "How to reset my password",
"type": "faq",
"agentIds": ["a8c87faa-219c-4fa9-bbc0-8acf826d9e6a", "97e07544-bf7a-4af6-864c-07736fffb5c2"],
"title": "How to reset my password",
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
"description": "This is a knowledge base",
"urls": ["https://example.com/knowledge-base"],
"refreshFrequency": "manual"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'How to reset my password',
type: 'faq',
agentIds: ['a8c87faa-219c-4fa9-bbc0-8acf826d9e6a', '97e07544-bf7a-4af6-864c-07736fffb5c2'],
title: 'How to reset my password',
text: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s',
description: 'This is a knowledge base',
urls: ['https://example.com/knowledge-base'],
refreshFrequency: 'manual'
})
};
fetch('https://api.elemente.ai/api/v1/knowledgebase', 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.elemente.ai/api/v1/knowledgebase",
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([
'name' => 'How to reset my password',
'type' => 'faq',
'agentIds' => [
'a8c87faa-219c-4fa9-bbc0-8acf826d9e6a',
'97e07544-bf7a-4af6-864c-07736fffb5c2'
],
'title' => 'How to reset my password',
'text' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s',
'description' => 'This is a knowledge base',
'urls' => [
'https://example.com/knowledge-base'
],
'refreshFrequency' => 'manual'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.elemente.ai/api/v1/knowledgebase"
payload := strings.NewReader("{\n \"name\": \"How to reset my password\",\n \"type\": \"faq\",\n \"agentIds\": [\n \"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a\",\n \"97e07544-bf7a-4af6-864c-07736fffb5c2\"\n ],\n \"title\": \"How to reset my password\",\n \"text\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s\",\n \"description\": \"This is a knowledge base\",\n \"urls\": [\n \"https://example.com/knowledge-base\"\n ],\n \"refreshFrequency\": \"manual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.elemente.ai/api/v1/knowledgebase")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"How to reset my password\",\n \"type\": \"faq\",\n \"agentIds\": [\n \"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a\",\n \"97e07544-bf7a-4af6-864c-07736fffb5c2\"\n ],\n \"title\": \"How to reset my password\",\n \"text\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s\",\n \"description\": \"This is a knowledge base\",\n \"urls\": [\n \"https://example.com/knowledge-base\"\n ],\n \"refreshFrequency\": \"manual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.elemente.ai/api/v1/knowledgebase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"How to reset my password\",\n \"type\": \"faq\",\n \"agentIds\": [\n \"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a\",\n \"97e07544-bf7a-4af6-864c-07736fffb5c2\"\n ],\n \"title\": \"How to reset my password\",\n \"text\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s\",\n \"description\": \"This is a knowledge base\",\n \"urls\": [\n \"https://example.com/knowledge-base\"\n ],\n \"refreshFrequency\": \"manual\"\n}"
response = http.request(request)
puts response.read_body{
"name": "How to reset my password",
"type": "faq",
"url": "https://example.com/knowledge-base",
"urls": [
"https://example.com/knowledge-base"
],
"agents": [
"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a",
"97e07544-bf7a-4af6-864c-07736fffb5c2"
],
"title": "How to reset my password",
"status": "active",
"description": "This is a description of the knowledge base",
"text": "This is a text of the knowledge base",
"isEveryone": false,
"refreshFrequency": "1h",
"workspace": "34319b9a-625a-4eef-a554-7ed0d27fce6b"
}Create knowledgebase
curl --request POST \
--url https://api.elemente.ai/api/v1/knowledgebase \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "How to reset my password",
"type": "faq",
"agentIds": [
"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a",
"97e07544-bf7a-4af6-864c-07736fffb5c2"
],
"title": "How to reset my password",
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
"description": "This is a knowledge base",
"urls": [
"https://example.com/knowledge-base"
],
"refreshFrequency": "manual"
}
EOFimport requests
url = "https://api.elemente.ai/api/v1/knowledgebase"
payload = {
"name": "How to reset my password",
"type": "faq",
"agentIds": ["a8c87faa-219c-4fa9-bbc0-8acf826d9e6a", "97e07544-bf7a-4af6-864c-07736fffb5c2"],
"title": "How to reset my password",
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
"description": "This is a knowledge base",
"urls": ["https://example.com/knowledge-base"],
"refreshFrequency": "manual"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'How to reset my password',
type: 'faq',
agentIds: ['a8c87faa-219c-4fa9-bbc0-8acf826d9e6a', '97e07544-bf7a-4af6-864c-07736fffb5c2'],
title: 'How to reset my password',
text: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s',
description: 'This is a knowledge base',
urls: ['https://example.com/knowledge-base'],
refreshFrequency: 'manual'
})
};
fetch('https://api.elemente.ai/api/v1/knowledgebase', 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.elemente.ai/api/v1/knowledgebase",
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([
'name' => 'How to reset my password',
'type' => 'faq',
'agentIds' => [
'a8c87faa-219c-4fa9-bbc0-8acf826d9e6a',
'97e07544-bf7a-4af6-864c-07736fffb5c2'
],
'title' => 'How to reset my password',
'text' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s',
'description' => 'This is a knowledge base',
'urls' => [
'https://example.com/knowledge-base'
],
'refreshFrequency' => 'manual'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.elemente.ai/api/v1/knowledgebase"
payload := strings.NewReader("{\n \"name\": \"How to reset my password\",\n \"type\": \"faq\",\n \"agentIds\": [\n \"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a\",\n \"97e07544-bf7a-4af6-864c-07736fffb5c2\"\n ],\n \"title\": \"How to reset my password\",\n \"text\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s\",\n \"description\": \"This is a knowledge base\",\n \"urls\": [\n \"https://example.com/knowledge-base\"\n ],\n \"refreshFrequency\": \"manual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.elemente.ai/api/v1/knowledgebase")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"How to reset my password\",\n \"type\": \"faq\",\n \"agentIds\": [\n \"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a\",\n \"97e07544-bf7a-4af6-864c-07736fffb5c2\"\n ],\n \"title\": \"How to reset my password\",\n \"text\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s\",\n \"description\": \"This is a knowledge base\",\n \"urls\": [\n \"https://example.com/knowledge-base\"\n ],\n \"refreshFrequency\": \"manual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.elemente.ai/api/v1/knowledgebase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"How to reset my password\",\n \"type\": \"faq\",\n \"agentIds\": [\n \"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a\",\n \"97e07544-bf7a-4af6-864c-07736fffb5c2\"\n ],\n \"title\": \"How to reset my password\",\n \"text\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s\",\n \"description\": \"This is a knowledge base\",\n \"urls\": [\n \"https://example.com/knowledge-base\"\n ],\n \"refreshFrequency\": \"manual\"\n}"
response = http.request(request)
puts response.read_body{
"name": "How to reset my password",
"type": "faq",
"url": "https://example.com/knowledge-base",
"urls": [
"https://example.com/knowledge-base"
],
"agents": [
"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a",
"97e07544-bf7a-4af6-864c-07736fffb5c2"
],
"title": "How to reset my password",
"status": "active",
"description": "This is a description of the knowledge base",
"text": "This is a text of the knowledge base",
"isEveryone": false,
"refreshFrequency": "1h",
"workspace": "34319b9a-625a-4eef-a554-7ed0d27fce6b"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
Input data for creating a new knowledge base
The name of the knowledge base
"How to reset my password"
The type of the knowledge base
"faq"
The list of agent IDs of the knowledge base that needs to be given access to this knowledgebase
[
"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a",
"97e07544-bf7a-4af6-864c-07736fffb5c2"
]
The title of the knowledge base
"How to reset my password"
The textual content of the knowledge base
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"
The description of the knowledge base
"This is a knowledge base"
The list of website URLs of the knowledge base, please see: (knowledgebase/extract-urls) for getting these urls
["https://example.com/knowledge-base"]
The refresh frequency of the knowledge base
"manual"
Response
Created knowledge base
The name of the knowledge base
"How to reset my password"
The type of the knowledge base
"faq"
The URL of the knowledge base
"https://example.com/knowledge-base"
The list of website URLs of the knowledge base
["https://example.com/knowledge-base"]
The list of agent IDs of the knowledge base
[
"a8c87faa-219c-4fa9-bbc0-8acf826d9e6a",
"97e07544-bf7a-4af6-864c-07736fffb5c2"
]
The title of the knowledge base
"How to reset my password"
The status of the knowledge base
"active"
The description of the knowledge base
"This is a description of the knowledge base"
The text of the knowledge base
"This is a text of the knowledge base"
Is the knowledge base accessible to everyone
false
The refresh frequency of the knowledge base
"1h"
The UUID of the workspace
"34319b9a-625a-4eef-a554-7ed0d27fce6b"
