rybbit_run_query
Run read-only SQL queries against your analytics events to extract insights. Filter by site or query across all accessible sites, with server-enforced safety limits.
Instructions
Run a read-only ClickHouse SQL query against your analytics events. Query the scoped_events table only (pre-filtered to sites your API key can access). Server-enforced limits: SELECT/WITH-SELECT statements only; max 1,000 result rows; 10-second execution cap; query length up to 20,000 chars; no semicolons; no quoted identifiers; DDL/DML keywords and remote table functions are blocked. Requires the sql:read scope. Call rybbit_get_query_schema first to see available columns. Omit siteId to query across all accessible sites in the organization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ClickHouse SELECT query against scoped_events (no semicolons) | |
| siteId | No | Optional numeric site ID to scope the query to a single site | |
| organizationId | Yes | Organization identifier (see rybbit_get_organizations) |