Skip to main content
POST
Crear un documento desde markdown. El contenido se convierte a BlockNote y se reindexa para búsquedas.
Creates a document in the knowledge base from Markdown. The API converts the Markdown to BlockNote (the editor format used by the portal) and triggers a reindex of the vector store and the full-text index so the document becomes immediately available in POST /v1/knowledge/search. The reindex is enqueued asynchronously in the processing service; the endpoint returns as soon as the document is persisted. Search may take a few seconds to surface the new content (depends on the queue).

Endpoint

Required scope

knowledge:write

Headers

Body

Example request

Response

201 Created

400 / 401 / 403 / 404 / 429

  • 400 BAD_REQUEST: title or markdown empty, parent_id points to a document.
  • 403 FORBIDDEN with code: INSUFFICIENT_SCOPE: the PAT doesn’t have knowledge:write.
  • 404 NOT_FOUND: parent_id doesn’t exist or belongs to another company.
To make sure the document is available to assistants, assign it with POST /v1/knowledge/assignments. The content is always searchable via the knowledge:query scope even if it isn’t assigned to any assistant.

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 del documento.

Maximum string length: 200
Example:

"Política de devolución"

markdown
string
required

Contenido en Markdown. Se convierte a BlockNote JSON al guardar.

Example:

"# Política\n\nTexto de la política..."

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 | null
created_at
string
updated_at
string