Skip to main content

API Reference

Complete API documentation for the CAIPE (Community AI Platform Engineering) platform. This reference covers the Next.js UI Backend API (/api/*) and points to related Python services (RAG, Dynamic Agents).

Authentication: Unless an endpoint explicitly says otherwise, assume NextAuth (OIDC session cookies). Many admin and enterprise routes additionally require Keycloak Authorization Services permissions (e.g. admin_ui#view, chat#invoke) and/or coarse session.role === 'admin'. A few routes accept Bearer tokens (e.g. skills catalog). Unauthenticated routes are called out per document (e.g. /api/health, /api/config).

Services overview​

ServiceTechnologyTypical baseAuthentication
UI Backend APINext.js API Routes/api/*NextAuth session; optional Bearer on selected routes
RAG ServerFastAPIRAG_SERVER_URL / NEXT_PUBLIC_RAG_URLBearer JWT (proxied from UI session)
Dynamic AgentsFastAPIDYNAMIC_AGENTS_URLBearer JWT (proxied from UI for writes)
Slack BotSlack BoltSocket ModeSlack signing secret; OBO JWT to CAIPE

Common response patterns (UI Backend API)​

Success (successResponse)​

{
"success": true,
"data": { }
}

Pagination (paginatedResponse)​

{
"success": true,
"data": {
"items": [],
"total": 150,
"page": 1,
"page_size": 20,
"has_more": true
}
}

Error (ApiError / withErrorHandler)​

{
"success": false,
"error": "Error message",
"code": "ERROR_CODE"
}

Some routes return plain JSON without the success wrapper (e.g. GET /api/admin/users, GET /api/rbac/permissions, unified audit endpoints).

Domain documentation​

DomainDescriptionDocument
Admin & user managementKeycloak user directory, realm role assignment, team KB membership, MongoDB teams CRUD, platform statsadmin-user-management.md
RBAC & rolesRealm roles, IdP mappers, permissions, CEL policies, admin tab gates, RBAC / unified auditrbac-roles.md
Chat & conversationsConversations, messages, sharing, pins, archive, searchchat-conversations.md
RAG & knowledge basesRAG proxies, KB RBAC proxy, team-scoped RAG tools (MongoDB)rag-knowledge-bases.md
Dynamic agents & MCPDynamic agent list/CRUD, SSE chat proxies, MCP server registrydynamic-agents-mcp.md
Slack integrationSlack user admin list, channel–team mappings, web identity link callbackslack-integration.md
PlatformHealth, runtime public config, version, skills catalog, catalog API keys, skill hubs & templatesplatform.md

OpenAPI specifications​

Machine-readable OpenAPI specs (where maintained):

ServiceSpec file
UI Backend APIopenapi/ui-backend-api.yaml
RAG Serveropenapi/rag-server.yaml
Dynamic Agentsopenapi/dynamic-agents.yaml