List Knowledge Bases
Returns a paginated list of the workspace’s knowledge bases, whatever their permission settings, optionally filtered by keyword or tags.
curl --request GET \
--url https://{api_base_url}/datasets \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/datasets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/datasets', 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_base_url}/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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_base_url}/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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_base_url}/datasets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"app_count": 0,
"author_name": "admin",
"built_in_field_enabled": true,
"chunk_structure": null,
"created_at": 1741267200,
"created_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"data_source_type": null,
"description": "Technical documentation for the product API",
"doc_form": "text_model",
"doc_metadata": [],
"document_count": 0,
"embedding_available": true,
"embedding_model": "text-embedding-3-small",
"embedding_model_provider": "langgenius/openai/openai",
"enable_api": true,
"external_knowledge_info": null,
"external_retrieval_model": null,
"icon_info": null,
"id": "c42e2a6e-40b3-4330-96f8-f1e4d768e8c9",
"indexing_technique": "high_quality",
"is_multimodal": false,
"is_published": false,
"maintainer": "admin",
"name": "Product Documentation",
"permission": "only_me",
"pipeline_id": null,
"provider": "vendor",
"retrieval_model_dict": {
"reranking_enable": false,
"reranking_mode": null,
"reranking_model": {
"reranking_model_name": "",
"reranking_provider_name": ""
},
"score_threshold": null,
"score_threshold_enabled": false,
"search_method": "semantic_search",
"top_k": 3,
"weights": null
},
"runtime_mode": null,
"summary_index_setting": null,
"tags": [],
"total_available_documents": 0,
"total_documents": 0,
"updated_at": 1741267200,
"updated_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"word_count": 0
}
],
"has_more": false,
"limit": 20,
"page": 1,
"total": 1
}{
"code": "forbidden",
"message": "The API key is not authorized to access this knowledge base.",
"status": 403
}Authorizations
Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).
Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).
Query Parameters
Page number. Values below 1 are treated as 1.
Number of items per page. Server caps at 100, and values below 1 are treated as 1.
Search keyword to filter by name.
Has no effect. The list isn't filtered by knowledge base permission settings.
Tag IDs to filter by. Get tag IDs from List Knowledge Type Tags.
Was this page helpful?
curl --request GET \
--url https://{api_base_url}/datasets \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/datasets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/datasets', 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_base_url}/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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_base_url}/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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_base_url}/datasets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"app_count": 0,
"author_name": "admin",
"built_in_field_enabled": true,
"chunk_structure": null,
"created_at": 1741267200,
"created_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"data_source_type": null,
"description": "Technical documentation for the product API",
"doc_form": "text_model",
"doc_metadata": [],
"document_count": 0,
"embedding_available": true,
"embedding_model": "text-embedding-3-small",
"embedding_model_provider": "langgenius/openai/openai",
"enable_api": true,
"external_knowledge_info": null,
"external_retrieval_model": null,
"icon_info": null,
"id": "c42e2a6e-40b3-4330-96f8-f1e4d768e8c9",
"indexing_technique": "high_quality",
"is_multimodal": false,
"is_published": false,
"maintainer": "admin",
"name": "Product Documentation",
"permission": "only_me",
"pipeline_id": null,
"provider": "vendor",
"retrieval_model_dict": {
"reranking_enable": false,
"reranking_mode": null,
"reranking_model": {
"reranking_model_name": "",
"reranking_provider_name": ""
},
"score_threshold": null,
"score_threshold_enabled": false,
"search_method": "semantic_search",
"top_k": 3,
"weights": null
},
"runtime_mode": null,
"summary_index_setting": null,
"tags": [],
"total_available_documents": 0,
"total_documents": 0,
"updated_at": 1741267200,
"updated_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"word_count": 0
}
],
"has_more": false,
"limit": 20,
"page": 1,
"total": 1
}{
"code": "forbidden",
"message": "The API key is not authorized to access this knowledge base.",
"status": 403
}