Bots — BotV2 y AIFlows
WhatsUY soporta dos motores de bots:
- BotV2: motor legacy basado en flow editor. Estable, en mantenimiento.
- AIFlows: nuevo motor con loops, switch, funciones reutilizables, asistente IA y agente IA directa con MCP. Recomendado para flujos nuevos.
Ver Bots · AIFlows para el detalle del nuevo motor.
Endpoints BotV2
# Crear bot
POST /bot
{ "reference": 12345, "name": "Soporte", "trigger": "always" }
# Obtener bot
GET /bot/:id
# Publicar
POST /bot/:id/publish
# Ejecutar manualmente
POST /bot/:id/run
{ "chatId": "59891234567@s.whatsapp.net", "input": "hola" }
Endpoints AIFlows
# Crear proyecto
POST /aiflow/project
{ "name": "Soporte v2", "description": "..." }
# Crear flujo
POST /aiflow/flow
{ "projectId": "...", "name": "flujo-principal", "draft": {...} }
# Publicar flujo
POST /aiflow/flow/:id/publish
# Ejecutar
POST /aiflow/run
{ "flowId": "...", "chatId": "59891234567@s.whatsapp.net", "input": {...} }
# Listar runs
GET /aiflow/run?flowId=<id>&limit=50
Extractors
Los extractors son funciones que extraen valores estructurados (regex, AI, intent, entity) de un mensaje entrante. Se configuran por bot o por referencia y se exponen vía:
POST /extractor
GET /extractor/:id
POST /extractor/:id/run
Detalle completo en
api-documentation/06-bots-extractors.mdxydoc-iaflows/07-API-REFERENCE.md.