Integration

Quick Reference (API usage)

Auth, endpoints, payloads, and copy-paste examples for common integrations.

Idioma:ESENFRPTDE
Última actualización: Apr 8, 2026quickreferenceendpoints

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
/chat
,
text
/agent-config
,
text
/billing/*
,
text
/users/*
.

Header :

text
Authorization: Bearer <jwt>

2) API key (secret du tenant)

Utilisé pour :

text
/public/session
,
text
/rag-config
,
text
/prompt-templates
,
text
/public/*
.

Header :

text
x-api-key: <tenant_api_key>

Règle : ne jamais livrer

text
x-api-key
au navigateur/app.


Flow B2C (recommandé)

A) Créer une session (server-side)

text
POST /public/session
(x-api-key)

bash
curl -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)

bash
curl -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"
  }'