Skip to main content

UI API Reference

The CAIPE UI API is a Next.js BFF. It serves browser requests, enforces UI-facing authz, persists UI data in MongoDB, and proxies selected backend services.

Backend Services​

ServiceConfiguration
Dynamic AgentsDYNAMIC_AGENTS_URL
Harness EngineHARNESS_ENGINE_URL, HARNESS_ENGINE_INTERNAL_TOKEN
MongoDBMONGODB_URI, MONGODB_DATABASE
RAG serverRAG_SERVER_URL
Slack bot admin APIconfigured bot admin URL/token
Webex bot admin APIconfigured bot admin URL/token

Chat Routes​

MethodRoutePurpose
POST/api/v1/chat/stream/startStart a declared AG-UI app stream, or dispatch through the pinned native/provider Harness Gateway
POST/api/v1/chat/stream/resumeResume a declared app stream or native interrupt; unsupported app resume returns 501 and unsupported provider resume returns 409
POST/api/v1/chat/stream/cancelCancel through the declared app endpoint or the pinned native/provider runtime; unsupported app cancel returns 501
POST/api/v1/chat/stream/statusObserve a declared app's turn status; unsupported runtimes return 501
POST/api/v1/chat/invokeNon-streaming native/provider invocation; app-owned assistants require their declared stream endpoints

All stream operations share one dispatcher after agent-use and conversation-write authorization. Installed app declarations select the app proxy with the same authenticated caller and original conversation ID. A claimed app operation, including its errors and denials, never dispatches to another runtime.

Other start/resume/cancel requests resolve the server-owned runtime conversation ID and the Harness Gateway's pinned backend. Dynamic Agents configuration is required only for a native request. Provider execution keeps its detached run and cursor replay contract; app streams retain their own deadlines and sessions.

Example:

curl -N -X POST http://localhost:3000/api/v1/chat/stream/start \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"message": "Check production ArgoCD apps",
"conversation_id": "conv-123",
"agent_id": "platform-engineer"
}'

Health And Config​

MethodRoutePurpose
GET/api/healthUI process health
GET/api/versionBuild metadata
GET/api/configClient-visible UI config
GET/api/admin/platform-configAdmin-managed runtime defaults

Skills​

MethodRoutePurpose
GET/api/skillsList catalog skills
POST/api/skillsCreate or update a skill
GET/api/skills/install.shRender local install script
POST/api/catalog-api-keysMint catalog API key

Dynamic Agent Admin​

MethodRoutePurpose
GET/api/dynamic-agents/availableList chat-capable agents
GET/api/dynamic-agents/configsList agent configs
POST/api/dynamic-agents/configsCreate agent config

Route files under ui/src/app/api are the implementation source of truth.

Native app chat activity​

POST /api/v1/chat/stream/status accepts {conversation_id, agent_id} and routes to an installed app's declared assistant status endpoint. It requires the same conversation-write and agent-use permissions as stream start. Unsupported runtimes return 501; app failures never fall back to another runtime.