curl --request GET \
--url https://api.trugen.ai/v1/ext/kbs \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trugen.ai/v1/ext/kbs"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trugen.ai/v1/ext/kbs', 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.trugen.ai/v1/ext/kbs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.trugen.ai/v1/ext/kbs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trugen.ai/v1/ext/kbs")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v1/ext/kbs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "ff152cd9-efb6-4367-a545-b861c9fbd3d0",
"name": "Sample Knowledge Base",
"description": "HR related policies.",
"no_of_rec": 20,
"documents": [
{
"id": "9a2ad090-aafe-4662-8eb8-a11a404431ea",
"name": "hr-policies.pdf",
"type": ".pdf",
"preview_url": "<PUBLIC_URL>"
}
],
"created_at": "2025-10-08T16:34:19.984033Z",
"updated_at": "2025-10-08T16:34:19.984033Z"
}
]{
"error": "Unauthorized: not a valid authorization api key"
}{
"error": "Failed to retrieve knowledge base"
}List All Knowledge Bases
Fetches a list of all available knowledge bases with their metadata and associated documents.
curl --request GET \
--url https://api.trugen.ai/v1/ext/kbs \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trugen.ai/v1/ext/kbs"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trugen.ai/v1/ext/kbs', 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.trugen.ai/v1/ext/kbs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.trugen.ai/v1/ext/kbs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trugen.ai/v1/ext/kbs")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v1/ext/kbs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "ff152cd9-efb6-4367-a545-b861c9fbd3d0",
"name": "Sample Knowledge Base",
"description": "HR related policies.",
"no_of_rec": 20,
"documents": [
{
"id": "9a2ad090-aafe-4662-8eb8-a11a404431ea",
"name": "hr-policies.pdf",
"type": ".pdf",
"preview_url": "<PUBLIC_URL>"
}
],
"created_at": "2025-10-08T16:34:19.984033Z",
"updated_at": "2025-10-08T16:34:19.984033Z"
}
]{
"error": "Unauthorized: not a valid authorization api key"
}{
"error": "Failed to retrieve knowledge base"
}Authorizations
Response
List of all knowledge bases you have access to.
Unique identifier of the knowledge base in UUID format.
"ff152cd9-efb6-4367-a545-b861c9fbd3d0"
Human-readable name of the knowledge base.
"Sample Knowledge Base"
Short description summarizing the purpose or content of the knowledge base.
"HR related policies."
Total number of records/documents stored in the knowledge base.
20
A list of documents stored inside the knowledge base. Each item represents a single document and contains the fields below.
Show child attributes
Show child attributes
Timestamp representing when the knowledge base was initially created (ISO 8601 format).
"2025-10-08T16:34:19.984033Z"
Timestamp representing the most recent update to the knowledge base (ISO 8601 format).
"2025-10-08T16:34:19.984033Z"
Was this page helpful?