Skip to main content
The chat query endpoint is the core of BoardPulse AI. You submit a question in plain English and receive a structured response that includes an AI-written executive summary, the SQL that was generated and executed, a data table, and downloadable export files.

Request

Method: POST
Path: /api/v1/chat/query
Content-Type: application/json

Body parameters

string
required
The natural-language question to ask. Must be between 2 and 2,000 characters.Example: "What were total sales by region last month?"
string
default:"default"
The workspace to query. Workspaces define which database and which tables are accessible. Use "default" unless you have configured multiple workspaces.
string
The specific model name to use for this request (e.g., "gpt-4.1-mini" or "qwen3:8b"). If omitted, the server uses the workspace’s configured default model.
string
Forces a specific AI provider for this request. One of "cloud", "local", "hybrid", or "mock". If omitted, the server selects based on configuration.
  • cloud — OpenAI-compatible remote API
  • local — Ollama running locally
  • hybrid — tries local (Ollama) first, falls back to cloud
  • mock — deterministic mock responses (for testing)
boolean
default:"true"
Whether to include the generated SQL in the response. Set to false if you only need the answer and table data.

Response

string
The executive-summary answer written by the AI model in plain language.
string | null
The SQL query generated by the AI before the row limit was applied. Present only when include_sql is true.
string | null
The actual SQL that was executed, including any LIMIT clause added by the guardrail layer. Always returned when a query was executed, regardless of the include_sql flag.
string
The name of the AI provider that processed the request (e.g., "openai", "ollama", "mock").
object | null
The query results as a structured table.
object | null
A chart specification if the AI determined the data is best presented visually.
object[]
List of downloadable export files generated for this response.
string[]
Any non-fatal warnings generated during processing, such as a row limit being applied.
object
Metadata about how the query was processed.
string
ISO 8601 datetime indicating when the response was generated (UTC).

Example