Docs

Query Analytics Data Source

Run one read-only SQL statement (DuckDB) over a data source's stored rows, read as src, to explore them before you build a panel: counts, distinct values, date ranges. Nothing is saved. It reads the rows the last fetch stored, so fetch first if they are old. For a source another member owns, send the id of a page shared with the creator that uses it.

POST

Path

Path parameters
stringrequired

The data source's id, from List Analytics Data Sources or a panel's dataSources.

Headers

Optional headers
string

Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See Organizations.

Body

Arguments
stringrequired

The SQL, reading the rows as src.

One read-only SELECT statement over the stored rows, read as `src`. DuckDB SQL.

number

How many rows, 1 to 200.

How many rows to answer, 1 to 200. Defaults to 200. Page past it with LIMIT and OFFSET in the SQL.

Default: 200

string

For a source another member owns: a page shared with the key's creator that uses it, from List Analytics Pages.

For a source another member owns: the id of a page shared with the key's creator that uses it, from List Analytics Pages.

Response fields

columnsarray of string

The column names of the answer, in order.

rowsarray of objects

The rows the SQL answered, as objects keyed by column.

hasMoreboolean

True when more rows match than limit answered: narrow the SQL, or page with LIMIT and OFFSET in it.