List Documents
curl --request GET \
--url https://api.example.com/api/knowledge-base \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.example.com/api/knowledge-base"
headers = {
"X-API-Key": "<x-api-key>",
"X-Organization-Id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-API-Key': '<x-api-key>', 'X-Organization-Id': '<x-organization-id>'}
};
fetch('https://api.example.com/api/knowledge-base', 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/api/knowledge-base",
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: <x-api-key>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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/api/knowledge-base"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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.example.com/api/knowledge-base")
.header("X-API-Key", "<x-api-key>")
.header("X-Organization-Id", "<x-organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/knowledge-base")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Organization-Id"] = '<x-organization-id>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"documentation_id": "doc_a1b2c3d4e5f6",
"name": "Product Manual.pdf",
"type": "file",
"size": 2450000,
"filename": "Product Manual.pdf",
"processing_status": "completed",
"page_count": 42,
"vector_count": 156,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:45:00Z"
},
{
"documentation_id": "doc_b2c3d4e5f6a7",
"name": "FAQ Text",
"type": "text",
"word_count": 1250,
"processing_status": "completed",
"vector_count": 32,
"created_at": "2024-01-10T09:00:00Z",
"updated_at": "2024-01-10T09:00:00Z"
}
],
"pagination": {
"next_cursor": "eyJkb2N1bWVudGF0aW9uX2lkIjogImRvY194eXoifQ==",
"has_more": true,
"page_size": 30
}
}
Knowledge Base
List Documents
GET
/
api
/
knowledge-base
List Documents
curl --request GET \
--url https://api.example.com/api/knowledge-base \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.example.com/api/knowledge-base"
headers = {
"X-API-Key": "<x-api-key>",
"X-Organization-Id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-API-Key': '<x-api-key>', 'X-Organization-Id': '<x-organization-id>'}
};
fetch('https://api.example.com/api/knowledge-base', 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/api/knowledge-base",
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: <x-api-key>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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/api/knowledge-base"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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.example.com/api/knowledge-base")
.header("X-API-Key", "<x-api-key>")
.header("X-Organization-Id", "<x-organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/knowledge-base")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Organization-Id"] = '<x-organization-id>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"documentation_id": "doc_a1b2c3d4e5f6",
"name": "Product Manual.pdf",
"type": "file",
"size": 2450000,
"filename": "Product Manual.pdf",
"processing_status": "completed",
"page_count": 42,
"vector_count": 156,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:45:00Z"
},
{
"documentation_id": "doc_b2c3d4e5f6a7",
"name": "FAQ Text",
"type": "text",
"word_count": 1250,
"processing_status": "completed",
"vector_count": 32,
"created_at": "2024-01-10T09:00:00Z",
"updated_at": "2024-01-10T09:00:00Z"
}
],
"pagination": {
"next_cursor": "eyJkb2N1bWVudGF0aW9uX2lkIjogImRvY194eXoifQ==",
"has_more": true,
"page_size": 30
}
}
List all knowledge base documents for your organization with pagination and filtering.
Headers
string
required
Your API key for authentication.
string
required
The organization ID.
Query Parameters
string
Pagination cursor for the next page.
integer
default:"30"
Number of documents per page (1-100).
string
Search by document name.
array
Filter by document types (
file, text). Can specify multiple.string
default:"created_at"
Field to sort by:
name, created_at, updated_at, or size.string
default:"desc"
Sort direction:
asc or desc.Permissions
kb:read(all roles)
Response
boolean
Indicates if the request was successful.
array
List of document summary objects.
object
{
"success": true,
"data": [
{
"documentation_id": "doc_a1b2c3d4e5f6",
"name": "Product Manual.pdf",
"type": "file",
"size": 2450000,
"filename": "Product Manual.pdf",
"processing_status": "completed",
"page_count": 42,
"vector_count": 156,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:45:00Z"
},
{
"documentation_id": "doc_b2c3d4e5f6a7",
"name": "FAQ Text",
"type": "text",
"word_count": 1250,
"processing_status": "completed",
"vector_count": 32,
"created_at": "2024-01-10T09:00:00Z",
"updated_at": "2024-01-10T09:00:00Z"
}
],
"pagination": {
"next_cursor": "eyJkb2N1bWVudGF0aW9uX2lkIjogImRvY194eXoifQ==",
"has_more": true,
"page_size": 30
}
}
⌘I