Obtener el árbol completo de carpetas y documentos de la base de conocimientos.
curl --request GET \
--url https://api.keebai.com/v1/knowledge/tree \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keebai.com/v1/knowledge/tree"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keebai.com/v1/knowledge/tree', 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.keebai.com/v1/knowledge/tree",
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.keebai.com/v1/knowledge/tree"
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.keebai.com/v1/knowledge/tree")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keebai.com/v1/knowledge/tree")
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{
"items": [
{
"id": "<string>",
"title": "<string>",
"position": 123,
"path_cache": "<string>",
"children": "<array>",
"parent_id": {},
"created_at": "<string>",
"updated_at": "<string>"
}
]
}Knowledge base
GET /v1/knowledge/tree
Returns the full tree of folders and documents in your company’s knowledge base.
GET
/
v1
/
knowledge
/
tree
Obtener el árbol completo de carpetas y documentos de la base de conocimientos.
curl --request GET \
--url https://api.keebai.com/v1/knowledge/tree \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keebai.com/v1/knowledge/tree"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keebai.com/v1/knowledge/tree', 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.keebai.com/v1/knowledge/tree",
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.keebai.com/v1/knowledge/tree"
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.keebai.com/v1/knowledge/tree")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keebai.com/v1/knowledge/tree")
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{
"items": [
{
"id": "<string>",
"title": "<string>",
"position": 123,
"path_cache": "<string>",
"children": "<array>",
"parent_id": {},
"created_at": "<string>",
"updated_at": "<string>"
}
]
}Returns the full hierarchy of active folders and documents in the knowledge base. The response is a tree nested by
parent_id, ordered by position. Nodes don’t include content (content_json / content_text) to keep the response lightweight — to create documents use POST /v1/knowledge/documents, and to search within their content use POST /v1/knowledge/search.
Endpoint
GET https://api.keebai.com/v1/knowledge/tree
Required scope
knowledge:read
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer kbai_pk_<token> |
Example request
curl https://api.keebai.com/v1/knowledge/tree \
-H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const resp = await fetch("https://api.keebai.com/v1/knowledge/tree", {
headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
});
const { items } = await resp.json();
import os, requests
resp = requests.get(
"https://api.keebai.com/v1/knowledge/tree",
headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
timeout=10,
)
resp.raise_for_status()
tree = resp.json()["items"]
Response
200 OK
{
"items": [
{
"id": "65f3a1b2c3d4e5f6a7b8c9d0",
"title": "Soporte",
"node_type": "folder",
"parent_id": null,
"position": 0,
"path_cache": "/Soporte",
"created_at": "2026-04-20T15:30:00.000Z",
"updated_at": "2026-04-20T15:30:00.000Z",
"children": [
{
"id": "65f3a1b2c3d4e5f6a7b8c9d1",
"title": "Política de devolución",
"node_type": "document",
"parent_id": "65f3a1b2c3d4e5f6a7b8c9d0",
"position": 0,
"path_cache": "/Soporte/Política de devolución",
"created_at": "2026-04-20T15:35:00.000Z",
"updated_at": "2026-04-20T15:35:00.000Z",
"children": []
}
]
}
]
}
| Field | Type | Description |
|---|---|---|
items[].id | string | ObjectId of the node. |
items[].title | string | Title as shown in the portal. |
items[].node_type | string | folder or document. |
items[].parent_id | string | null | ObjectId of the parent folder. null if at the root. |
items[].position | number | Order within the parent (lowest first). |
items[].path_cache | string | Concatenated path (e.g. /Soporte/Política de devolución). |
items[].children | array | Direct children of the node, with the same structure. |
401 / 403 / 429
Standard auth, scope, and rate limit errors.Was this page helpful?
⌘I