Chat Endpoint
AI Chat transforms data analytics into a conversation. Instead of manually building dashboards or writing queries, users simply describe what they want to see or understand. The AI interprets the request, processes the data, and responds with insights, explanations, or generates/modifies dashboards automatically (based both on the current user message and the conversation history).
Key Capabilities
Natural Language Dashboard Generation Create dashboards by describing what you want: "Show me sales by region for Q4" or "Create a chart comparing product categories by revenue."
Dashboard Editing Modify existing dashboards conversationally: "Add a filter for date range" or "Change the pie chart to a bar chart."
Data Analysis Ask questions about your data: "What are the top 5 customers by revenue?" or "Show me trends in customer satisfaction scores."
Conversational Context The AI maintains conversation history, allowing follow-up questions and refinements: "Now break that down by month" or "Filter to just the Technology category."
Endpoints
Send Message
POST /api/reveal/ai/chat
Clear Session
DELETE /api/reveal/ai/chat/session
Request Format
{
// Required
datasourceId: string, // Datasource identifier for context
// Message (one required)
message?: string, // Natural language message/request
// Optional context
dashboard?: string, // Dashboard JSON for editing/analysis
visualizationId?: string, // Visualization ID for visualization-specific operations
// Optional configuration
model?: string, // LLM model override
stream?: boolean // Return SSE stream instead of JSON (default: false)
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
datasourceId | string | Yes | Identifier of the datasource to query |
message | string | Conditional* | User's natural language message or request |
dashboard | string | No | Dashboard JSON (RDash format) for editing or analysis context |
visualizationId | string | No | Visualization identifier for visualization-specific operations |
model | string | No | Name of specific LLM model to use for this request |
stream | boolean | No | When true, returns a text/event-stream (SSE) response with progress events, text chunks, and a final complete event. When false (default), returns a plain application/json response. |
* Either message or intent must be provided
Parameter Details:
datasourceId: Required for all requests. Provides context about available data structures.dashboard: Provide when editing existing dashboards or analyzing dashboard content.
Response Format
Non-Streaming (default)
When stream is false or omitted, the endpoint returns a plain JSON response:
{
"explanation": "Based on your data, I've created a dashboard showing sales by region...",
"dashboard": "{...rdash JSON...}"
}
On error, the response includes an error message with the appropriate HTTP status code (400 or 500):
{
"error": "Error message"
}
Streaming
When stream is true, the endpoint returns Server-Sent Events (SSE) with the following event types:
progress Event
Sent during processing to indicate current status.
event: progress
data: {"message": "Creating a new dashboard"}
Common progress messages:
- "Creating a new dashboard"
- "Analyzing the current dashboard"
- "Adding filters to visualizations"
- "Modifying visualization"