Integration

Quick Reference (API usage)

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

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

Referência rápida — Integrações (copy/paste)

Esta página é um cheat-sheet para integrar CLIA rapidamente.

Para B2C embutido, comece aqui:

  • text
    /docs/b2c-agent-embedding-guide

Base URL

  • Produção:
    text
    https://clia-backend.frontiercodes.com

Autenticação (escolha a certa)

1) JWT (usuário do dashboard)

Usado para:

text
/chat
,
text
/agent-config
,
text
/billing/*
,
text
/users/*
.

text
Authorization: Bearer <jwt>

2) API key (segredo do tenant)

Usado para:

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

text
x-api-key: <tenant_api_key>

Regra: nunca coloque

text
x-api-key
no browser/app.


Fluxo B2C (recomendado)

A) Criar sessão (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) Enviar mensagem (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": "Olá!",
    "sessionId": "sess_...",
    "workspaceId": "WORKSPACE_ID",
    "externalCustomerId": "enduser_123"
  }'