Crear un documento desde markdown. El contenido se convierte a BlockNote y se reindexa para búsquedas.
Knowledge base
POST /v1/knowledge/documents
Create a document from Markdown. The content is converted to BlockNote and reindexed for search.
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
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer kbai_pk_<token> |
Content-Type | Yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Document title. Max. 200 characters. |
parent_id | string | No | ObjectId of the parent folder. Omit to create at the root. |
markdown | string | Yes | Markdown content. Supports headings (# ## ###), lists (bulleted, numbered, and task lists) and tables. |
Example request
Response
201 Created
| Field | Type | Description |
|---|---|---|
id | string | ObjectId of the created document. |
node_type | string | Always document. |
path_cache | string | Absolute path computed at creation. |
400 / 401 / 403 / 404 / 429
400 BAD_REQUEST:titleormarkdownempty,parent_idpoints to a document.403 FORBIDDENwithcode: INSUFFICIENT_SCOPE: the PAT doesn’t haveknowledge:write.404 NOT_FOUND:parent_iddoesn’t exist or belongs to another company.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Body
application/json
Título del documento.
Maximum string length:
200Example:
"Política de devolución"
Contenido en Markdown. Se convierte a BlockNote JSON al guardar.
Example:
"# Política\n\nTexto de la política..."
ObjectId de la carpeta padre. Omitir para crear en la raíz.