Chat API
GET /api/v1/conversations/sitegpt/chat-logs
Summary: Get Sitegpt Chat Logs
Get chat logs for SiteGPT UI.
Returns formatted chat log items with preview and time info.
Response Schema (SiteGPTChatLogsResponse - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
chat_logs | array of SiteGPTChatLogItem | * | |
total_items | integer | * |
GET /api/v1/conversations/chatbase/dashboard
Summary: Get Chatbase Dashboard
Get Chatbase dashboard data.
Shows sources overview and statistics.
Response Schema (ChatbaseDashboard - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
sources | ChatbaseSourceStats | * | |
source_items | array of ChatbaseSourceItem | * | |
retraining_required | boolean | * | |
last_trained_at | any | * |
POST /api/v1/chat
Summary: Chat with the agent
Send a message to the organization's entry agent.
Requires a credential (publishable key, delegated end-user token, or a Pragence user JWT) — no anonymous-without-key access. The agent is resolved from the organization (domain/subdomain, or the caller's org) via its default project. Identity is taken from the auth context, never the body, so it can't be spoofed:
- a Pragence user (JWT) tags the conversation with
user_id; - an end-user (delegated token / anonymous publishable session) tags it
with
external_user_id.
Request Schema (EndUserChatRequest):
| Property | Type | Required | Description |
|---|---|---|---|
content | string | * | |
thread_id | any |
POST /api/v1/chat/stream
Summary: Stream a chat reply (SSE)
Streaming variant of /chat — emits Server-Sent Events.
Frames: {"type":"start","thread_id"}, repeated {"type":"token","content"}, a final {"type":"complete","answer","ui_blocks","thread_id"}, then [DONE]. Same auth/identity model as /chat (credential required; identity from the token, not the body).
Request Schema (EndUserChatRequest):
| Property | Type | Required | Description |
|---|---|---|---|
content | string | * | |
thread_id | any |
POST /api/v1/admin/playground/chat
Summary: Test Chat
Test chat/RAG queries with detailed pipeline breakdown.
Admin only - Test full RAG pipeline before exposing to end users.
Credits: 1-2 credits per chat test (2 if reformulation is triggered).
Features:
- Stage-by-stage latency breakdown (retrieval, fusion, reranking, critique, generation)
- CrossEncoder reranking scores
- Critique node analysis and quality score
- Reformulation detection and analysis
- Gap analysis for answer quality
Use this to:
- Benchmark end-to-end RAG quality
- Identify bottlenecks in the pipeline
- Evaluate answer quality for specific topics
- Debug reformulation triggers
Request Schema (PlaygroundChatRequest):
| Property | Type | Required | Description |
|---|---|---|---|
query | string | * | Chat query to test |
collection_id | any | Filter to specific collection | |
project_id | any | Filter to specific project | |
thread_id | any | Thread ID for conversation context | |
show_retrieval_details | boolean | Include detailed retrieval info | |
show_reranking_scores | boolean | Show CrossEncoder reranking scores | |
show_critique_details | boolean | Show critique node analysis |
Response Schema (PlaygroundChatResponse - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
query | string | * | Query that was tested |
answer | string | * | Generated answer |
total_latency_ms | number | * | Total execution time |
stage_breakdown | array of RetrievalStageDetails | Breakdown by pipeline stage | |
citations | array of object | Source citations | |
retrieval_scores | any | Scores by retrieval method | |
reranking_scores | any | CrossEncoder reranking scores | |
critique_score | any | Critique node quality score (0-1) | |
critique_feedback | any | Critique node feedback | |
source | string | Answer source (knowledge_base or general_knowledge) | |
kb_documents_found | boolean | Whether KB documents were found | |
iterations | integer | Number of agent iterations | |
reformulation_triggered | boolean | Whether query reformulation was triggered | |
reformulated_query | any | Reformulated query (if triggered) | |
gaps | array of object | Identified gaps and issues | |
thread_id | any | Conversation thread ID | |
request_id | string | * | Unique request ID for tracing |
credits_used | any | Credits consumed (1 normal, 2 with reformulation) | |
credits_remaining | any | Remaining credit balance |
POST /api/v1/projects/{project_id}/chat
Summary: Chat with the project's agents
Request Schema (AgentChatRequest):
| Property | Type | Required | Description |
|---|---|---|---|
query | string | * | |
thread_id | any | ||
collection_id | any | ||
use_cache | boolean |