Quick Reference — Integrations (copy/paste)
This page is a developer cheat-sheet for integrating CLIA quickly.
If you are embedding CLIA into a B2C product, start here:
- text
/docs/b2c-agent-embedding-guide
Base URL
- Production: text
https://clia-backend.frontiercodes.com
Authentication (choose the right one)
1) JWT (tenant dashboard user)
Used for:
text
/chattext
/agent-configtext
/billing/*text
/users/*Header:
textAuthorization: Bearer <jwt>
2) API key (tenant secret)
Used for:
text
/public/sessiontext
/rag-configtext
/prompt-templatestext
/public/*Header:
textx-api-key: <tenant_api_key>
Rule: Never ship to the browser/mobile app.textx-api-key
3) executionToken (runtime, short-lived)
Used for: tools/MCP calls in end-user runtime (when applicable).
Header:
textAuthorization: Bearer <executionToken>
B2C Embed flow (recommended)
A) Mint a session (server-side)
text
POST /public/sessionbashcurl -X POST "https://clia-backend.frontiercodes.com/public/session" \ -H "Content-Type: application/json" \ -H "x-api-key: $CLIA_TENANT_API_KEY" \ -d '{ "agentId": "AGENT_ID", "channel": "chat", "externalCustomerId": "enduser_123", "scopes": ["mcp:access", "tool:http_request"] }'
B) Send a message (frontend → agentEndpoint)
bashcurl -X POST "https://<your-agent-endpoint>/webhook/chat" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $EXECUTION_TOKEN" \ -d '{ "agentId": "AGENT_ID", "query": "Hello!", "sessionId": "sess_...", "workspaceId": "WORKSPACE_ID", "externalCustomerId": "enduser_123" }'
Tenant Chat (dashboard user) — JWT
text
POST /chatbashcurl -X POST "https://clia-backend.frontiercodes.com/chat" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $CLIA_JWT" \ -d '{ "agentId": "AGENT_ID", "query": "Hello!", "sessionId": "session-123", "context": {} }'
Agent personalization (Prompts + Model) — JWT
text
PUT /agent-configbashcurl -X PUT "https://clia-backend.frontiercodes.com/agent-config" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $CLIA_JWT" \ -d '{ "agentId": "AGENT_ID", "systemPrompt": "You are a helpful assistant...", "temperature": 0.8, "maxTokens": 3000, "model": "gpt-4o-mini" }'
Knowledge Base (RAG) config — x-api-key (server-side)
text
PUT /rag-configbashcurl -X PUT "https://clia-backend.frontiercodes.com/rag-config" \ -H "Content-Type: application/json" \ -H "x-api-key: $CLIA_TENANT_API_KEY" \ -d '{ "agentId": "AGENT_ID", "dataEndpoint": "https://api.yourcompany.com/kb", "dataEndpointMethod": "GET", "isPaginated": false }'