KB Search Agent
Meer documentatie
API Endpoints
De KB Search Agent communiceert met de WATCH API V2 op aipromptpower.com. Hieronder staan alle endpoints die de agent gebruikt.
Authenticatie
POST /api/v2/auth/login
Content-Type: application/json
{
"employee_code": "REINT",
"password": "..."
}
Response: { "data": { "access_token": "eyJ..." } }
Chat (semantisch zoeken + LLM antwoord)
POST /api/v2/chat/WATCH-KB-SEARCH/{template_code}
Authorization: Bearer {token}
Content-Type: application/json
{
"question": "Hoe werkt de artikelbijlage?",
"conversation_id": "kb-agent-2026-03-27-11-00"
}
De conversation_id koppelt vervolgvragen aan hetzelfde gesprek. Wordt gelogd in CHAT_CONVERSATIONS.
Keyword Search (bronnen zoeken op tekst)
GET /api/v2/knowledge-bases/{kb_code}/sources?search={term}&status=L&limit=20
Authorization: Bearer {token}
Doorzoek elke KB apart. Combineert resultaten uit meerdere KB's.
Volledige Brontekst
GET /api/v2/knowledge-bases/{kb_code}/sources/{source_code}
Authorization: Bearer {token}
Retourneert complete_content (LONGTEXT) met de volledige brontekst.
Chunk Search
GET /api/v2/knowledge-bases/{kb_code}/sources/{source_code}/chunks?search={term}&limit=20
Authorization: Bearer {token}
Context Blocks (beheer)
GET /api/v2/context-blocks
GET /api/v2/context-blocks/{code}
POST /api/v2/context-blocks
PATCH /api/v2/context-blocks/{code}
DELETE /api/v2/context-blocks/{code}
AI Models (beheer)
GET /api/v2/ai-models
GET /api/v2/ai-models/{code}
POST /api/v2/ai-models
PATCH /api/v2/ai-models/{code}
POST /api/v2/ai-models/{code}/costs
GET /api/v2/ai-model-settings
GET /api/v2/ai-model-settings/{code}
POST /api/v2/ai-model-settings
PATCH /api/v2/ai-model-settings/{code}
Base URL
Alle endpoints zijn relatief ten opzichte van:
https://www.aipromptpower.com/source/api-v2/public/api/v2/