Create Knowledge Base
curl --request POST \
--url https://api.example.com/knowledge-basesimport requests
url = "https://api.example.com/knowledge-bases"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/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.example.com/knowledge-bases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/knowledge-bases"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/knowledge-bases")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/knowledge-bases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyKnowledge Bases
Create Knowledge Base
Creates a new knowledge base.
POST
/
knowledge-bases
Create Knowledge Base
curl --request POST \
--url https://api.example.com/knowledge-basesimport requests
url = "https://api.example.com/knowledge-bases"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/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.example.com/knowledge-bases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/knowledge-bases"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/knowledge-bases")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/knowledge-bases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint
Requires header
POST https://gateway.orkeia.ai/knowledge-bases
AuthenticationRequires header
authorization: <your_token>.
Request body
The service expects a wrapper withknowledgeBaseandfilename.
{
"knowledgeBase": {
"name": "Internal Policies",
"description": "Official corporate documents",
"enabled": true,
"sectors": ["hr", "legal"],
"content": "https://storage.orkeia.ai/kb/policies.pdf",
"type": "file",
"multimodal": false,
"tags": ["compliance", "contracts"]
},
"filename": "policies.pdf"
}
Notes
- For
type: "file", send the correspondingfilenameto the stored content.- For
type: "url"ortype: "text",filenamecan be ignored/left empty, but the field exists in the payload for endpoint consistency.content:
file: storage path/URL of the file (e.g., S3/Storage).url: public/private link to be referenced.text: direct textual content.
Example (cURL)
curl -X POST "https://gateway.orkeia.ai/knowledge-bases" -H "Authorization: Bearer <your_token>" -H "Content-Type: application/json" -d '{
"knowledgeBase": {
"name": "Internal Policies",
"description": "Official corporate documents",
"enabled": true,
"sectors": ["hr", "legal"],
"content": "https://storage.orkeia.ai/kb/policies.pdf",
"type": "file",
"multimodal": false,
"tags": ["compliance", "contracts"]
},
"filename": "policies.pdf",
}'
Reference Interface:
export interface KnowledgeBase {
id?: string;
name: string;
description: string;
enabled: boolean;
sectors: string[];
content: string;
type: 'file' | 'url' | 'text';
multimodal: boolean;
tags: string[];
}
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| id | string | No | Unique identifier of the knowledge base (returned by the backend). | ”KB_123456” |
| name | string | Yes | Name of the knowledge base. | ”Internal Policies” |
| description | string | Yes | Brief description of the content/usage. | ”Official corporate documents” |
| enabled | boolean | Yes | Indicates whether the base will be active in the environment. | true |
| sectors | string[] | Yes | Sectors that can consume this base (access governance). | [“hr”, “legal”] |
| content | string | Yes | Source of the content: file path/URL, external link, or literal text (according to type). | “https://storage.orkeia.ai/kb/policies.pdf” |
| type | ”file” | “url” | “text” | Yes | Type of the content. | ”file” |
| multimodal | boolean | Yes | Whether the base contains modalities beyond text (images/audio/video). | false |
| tags | string[] | Yes | Metadata/tags for search and organization. | [“compliance”,“contracts”] |
Responses
Response - Success
response
{
"status": "OK",
"data": { "id": "KB_123456" }
}
500 — Bad Request
{
"status": "ERROR",
"code": "server/error",
"data": null
}
400 — Client Error
{
"status": "ERROR",
"code": "client/error",
"data": null
}
Was this page helpful?
⌘I
