Référence rapide — Intégrations (copier/coller)
Cette page est un cheat-sheet développeur pour intégrer CLIA rapidement.
Pour un produit B2C embarqué, commencez ici :
- text
/docs/b2c-agent-embedding-guide
Base URL
- Production : text
https://clia-backend.frontiercodes.com
Authentification (choisir la bonne)
1) JWT (utilisateur dashboard tenant)
Utilisé pour :
text
/chattext
/agent-configtext
/billing/*text
/users/*Header :
textAuthorization: Bearer <jwt>
2) API key (secret du tenant)
Utilisé pour :
text
/public/sessiontext
/rag-configtext
/prompt-templatestext
/public/*Header :
textx-api-key: <tenant_api_key>
Règle : ne jamais livrer au navigateur/app.textx-api-key
Flow B2C (recommandé)
A) Créer une 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) Envoyer un 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": "Bonjour !", "sessionId": "sess_...", "workspaceId": "WORKSPACE_ID", "externalCustomerId": "enduser_123" }'