Skip to main content
POST
/
v1
/
knowledge
/
folders
Crear una carpeta en la base de conocimientos.
curl --request POST \
  --url https://api.keebai.com/v1/knowledge/folders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Soporte",
  "parent_id": "<string>"
}
'
{
  "id": "<string>",
  "title": "<string>",
  "position": 123,
  "path_cache": "<string>",
  "parent_id": {},
  "created_at": "<string>",
  "updated_at": "<string>"
}
Creates an empty folder in the knowledge base. Folders are containers: they group documents and other folders, but have no content of their own. To create documents use POST /v1/knowledge/documents.

Endpoint

POST https://api.keebai.com/v1/knowledge/folders

Required scope

knowledge:write

Headers

HeaderRequiredValue
AuthorizationYesBearer kbai_pk_<token>
Content-TypeYesapplication/json

Body

FieldTypeRequiredDescription
titlestringYesFolder name. Max. 200 characters.
parent_idstringNoObjectId of the parent folder. Omit to create at the root.

Example request

curl -X POST https://api.keebai.com/v1/knowledge/folders \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Soporte",
    "parent_id": "65f3a1b2c3d4e5f6a7b8c9d0"
  }'

Response

201 Created

{
  "id": "65f3a1b2c3d4e5f6a7b8c9d2",
  "title": "Soporte",
  "node_type": "folder",
  "parent_id": "65f3a1b2c3d4e5f6a7b8c9d0",
  "position": 3,
  "path_cache": "/Catálogo/Soporte",
  "created_at": "2026-04-27T15:30:00.000Z",
  "updated_at": "2026-04-27T15:30:00.000Z"
}
FieldTypeDescription
idstringObjectId of the newly created node.
titlestringSaved title.
node_typestringAlways folder.
parent_idstring | nullParent if provided, null if at the root.
positionnumberAssigned position (last in its level).
path_cachestringAbsolute path computed at creation.

400 / 401 / 403 / 404 / 429

  • 400 BAD_REQUEST: title empty or longer than 200, parent_id with invalid format, or parent_id pointing to a document (not a folder).
  • 403 FORBIDDEN with code: INSUFFICIENT_SCOPE: the PAT doesn’t have knowledge:write.
  • 404 NOT_FOUND: the parent_id doesn’t exist or doesn’t belong to your company.

Authorizations

Authorization
string
header
required

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

Body

application/json
title
string
required

Título de la carpeta.

Maximum string length: 200
Example:

"Soporte"

parent_id
string

ObjectId de la carpeta padre. Omitir para crear en la raíz.

Response

201 - application/json
id
string
required
title
string
required
node_type
enum<string>
required
Available options:
folder,
document
position
number
required
path_cache
string
required
parent_id
object
created_at
string
updated_at
string