Clickhouse Org Analytics
POST /clickhouse/org-analytics
POST
/clickhouse/org-analytics
Per-org visitor + intent analytics from ch3.
The database name is always derived from the authenticated user’s
organization.id (lower-cased) — the request body never carries
an org_id. The agent cannot reach another org’s data even if it
tries.
Authorizations
Parameters
Header Parameters
Request Body required
object
aggregation
‘raw’ returns the matching rows (capped). ‘daily_counts’ returns {day, count}. ‘top_n’ returns {value, count} grouped by the dataset’s primary group key (contact_id, company_id, keyword_id).
string
dataset
required
Which per-org table to read.
string
filters
Optional equality filters. Keys must match dataset columns; unknown columns are silently dropped so an LLM guess can’t produce a SQL error.
object
key
additional properties
any
limit
integer
since
required
ISO date or datetime (inclusive lower bound).
string
Responses
200
Successful Response
object
data
required
object
aggregation
required
string
dataset
required
string
rows
Array<object>
object
key
additional properties
any
total
integer
window
object
key
additional properties
string
pagination
Any of:
null
422
Validation Error
object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string