Bot · Conocimiento (RAG)
Referencia de 12 endpoints generados desde mosend-wb-backend/src/modules/bot/knowledge/knowledge.controller.ts.
/organizations/:orgId/bot/knowledge·12 endpoints·Source: mosend-wb-backend/src/modules/bot/knowledge/knowledge.controller.ts/organizations/:orgId/bot/knowledgeLista los documentos del knowledge base del bot.
Path params
orgIdstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
}
],
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/searchBúsqueda semántica (RAG) sobre el knowledge base: embedding del query + similitud coseno sobre los chunks. Mismo retrieval que usa el bot IA.
Path params
orgIdstringrequerido
Body (JSON)
querystringrequeridotopKnumberCuántos chunks devolver (1-20, default 5).
tagsstring[]Filtrar a docs que tengan alguno de estos tags.
minSimilaritynumberUmbral de similitud coseno 0-1 (default 0.3).
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/search' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"query": "<query>","topK": 0,"tags": [],"minSimilarity": 0}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/insightsQué buscó el bot en la memoria en los últimos N días: consultas, tasa de respuesta, preguntas sin respuesta agrupadas, uso por agente y por documento.
Path params
orgIdstringrequerido
Query params
diasstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/insights' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
}
],
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/notesCrea una nota (texto escrito en el panel) que el bot usa como conocimiento; se procesa como un documento.
Path params
orgIdstringrequerido
Body (JSON)
titlestringcontentstringtagsstring[]resolvesQuestionKeystringClave de la pregunta sin respuesta que esta nota cubre (viene de insights).
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/notes' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"title": "<title>","content": "<content>","tags": [],"resolvesQuestionKey": "<resolvesQuestionKey>"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/urlImporta una página web pública como fuente de conocimiento; con syncEveryHours se vuelve a leer periódicamente.
Path params
orgIdstringrequerido
Body (JSON)
urlstringrequeridotitlestringtagsstring[]syncEveryHoursnumberCada cuántas horas volver a leer la página; sin valor = solo a mano.
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/url' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"url": "https://tu-app.com/endpoint","title": "<title>","tags": [],"syncEveryHours": 0}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/notes/:idEdita una nota; si cambia el texto se vuelve a procesar.
Path params
orgIdstringrequeridoidstringrequerido
Body (JSON)
titlestringcontentstringtagsstring[]resolvesQuestionKeystringClave de la pregunta sin respuesta que esta nota cubre (viene de insights).
Respuestas
- 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/notes/00000000-0000-0000-0000-000000000000' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"title": "<title>","content": "<content>","tags": [],"resolvesQuestionKey": "<resolvesQuestionKey>"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/:idObtiene el detalle de un documento del knowledge base.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/00000000-0000-0000-0000-000000000000' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledgeSube un documento. Multipart: file + opcional title, tags (coma).
Path params
orgIdstringrequerido
Body (JSON)
titlestringtagsstringLista de tags separados por coma (viene como string en multipart).
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"title": "<title>","tags": "<tags>"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/:id/titleRenombra un documento del knowledge base.
Path params
orgIdstringrequeridoidstringrequerido
Body (JSON)
titlestringrequerido
Respuestas
- 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/00000000-0000-0000-0000-000000000000/title' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"title": "<title>"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/:id/tagsRe-etiqueta un documento (afecta qué bots lo usan).
Path params
orgIdstringrequeridoidstringrequerido
Body (JSON)
tagsstring[]requerido
Respuestas
- 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/00000000-0000-0000-0000-000000000000/tags' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"tags": []}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "cliente-vip",
"color": "#16a34a"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/:id/reprocessRe-extrae texto + regenera embeddings.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/00000000-0000-0000-0000-000000000000/reprocess' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/bot/knowledge/:idElimina un documento del knowledge base (chunks y objeto S3).
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 200
curl -X DELETE 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/bot/knowledge/00000000-0000-0000-0000-000000000000' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}