Skip to main content
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>'
{
  "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

HeaderRequiredValue
AuthorizationYesBearer kbai_pk_<token>

Example request

curl https://api.keebai.com/v1/knowledge/tree \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

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": []
        }
      ]
    }
  ]
}
FieldTypeDescription
items[].idstringObjectId of the node.
items[].titlestringTitle as shown in the portal.
items[].node_typestringfolder or document.
items[].parent_idstring | nullObjectId of the parent folder. null if at the root.
items[].positionnumberOrder within the parent (lowest first).
items[].path_cachestringConcatenated path (e.g. /Soporte/Política de devolución).
items[].childrenarrayDirect children of the node, with the same structure.

401 / 403 / 429

Standard auth, scope, and rate limit errors.

Authorizations

Authorization
string
header
required

Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.

Response

200 - application/json
items
object[]
required