Pragence

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):

PropertyTypeRequiredDescription
chat_logsarray of SiteGPTChatLogItem*
total_itemsinteger*

GET /api/v1/conversations/chatbase/dashboard

Summary: Get Chatbase Dashboard

Get Chatbase dashboard data.

Shows sources overview and statistics.

Response Schema (ChatbaseDashboard - Status 200):

PropertyTypeRequiredDescription
sourcesChatbaseSourceStats*
source_itemsarray of ChatbaseSourceItem*
retraining_requiredboolean*
last_trained_atany*

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):

PropertyTypeRequiredDescription
contentstring*
thread_idany

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):

PropertyTypeRequiredDescription
contentstring*
thread_idany

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):

PropertyTypeRequiredDescription
querystring*Chat query to test
collection_idanyFilter to specific collection
project_idanyFilter to specific project
thread_idanyThread ID for conversation context
show_retrieval_detailsbooleanInclude detailed retrieval info
show_reranking_scoresbooleanShow CrossEncoder reranking scores
show_critique_detailsbooleanShow critique node analysis

Response Schema (PlaygroundChatResponse - Status 200):

PropertyTypeRequiredDescription
querystring*Query that was tested
answerstring*Generated answer
total_latency_msnumber*Total execution time
stage_breakdownarray of RetrievalStageDetailsBreakdown by pipeline stage
citationsarray of objectSource citations
retrieval_scoresanyScores by retrieval method
reranking_scoresanyCrossEncoder reranking scores
critique_scoreanyCritique node quality score (0-1)
critique_feedbackanyCritique node feedback
sourcestringAnswer source (knowledge_base or general_knowledge)
kb_documents_foundbooleanWhether KB documents were found
iterationsintegerNumber of agent iterations
reformulation_triggeredbooleanWhether query reformulation was triggered
reformulated_queryanyReformulated query (if triggered)
gapsarray of objectIdentified gaps and issues
thread_idanyConversation thread ID
request_idstring*Unique request ID for tracing
credits_usedanyCredits consumed (1 normal, 2 with reformulation)
credits_remaininganyRemaining credit balance

POST /api/v1/projects/{project_id}/chat

Summary: Chat with the project's agents

Request Schema (AgentChatRequest):

PropertyTypeRequiredDescription
querystring*
thread_idany
collection_idany
use_cacheboolean

On this page