Skip to contentSkip to page list

Docs

Overview

Run a read-only LangWatchQL SELECT over your project's analytics views, or discover which views and columns your key can query.

On this page

The Query API runs read-only LangWatchQL SELECT statements over your project's analytics views. POST /api/v1/query runs one statement. GET /api/v1/query/schema lists the views, columns, and function names your key can query.

The request body is the query itself, and a 200 is the result itself: no envelope, no wrapper object around it. A failure answers with the standard LangWatch error envelope and a real HTTP status, so one parser reads every response.

Endpoints

MethodPathDescription
POST/api/v1/queryRun one LangWatchQL statement.
GET/api/v1/query/schemaList queryable views, columns, permission gates, and function names.

Authentication

Send your LangWatch API key in any one of these forms:

FormHeader
Token headerX-Auth-Token: <token>
BearerAuthorization: Bearer <token>
BasicAuthorization: Basic base64(projectId:token)

Any LangWatch API key works here: project, organization, or personal. Rows come from every project the key holds the analytics:view permission on: a project key reaches its one project, an organization or personal key reaches every project it can read. No project header is required.

To run POST /api/v1/query over one project only, send its id as projectId in the request body: the run then reads that project's rows alone, under that project's own content protections. Without projectId the run covers every project the key can read.

You can also filter inside the statement itself with WHERE TenantId = '<project id>', but the result is then redacted by the strictest protection across all the projects the key can read.

A result that mixes rows from more than one project carries the MULTI_PROJECT_RESULT diagnostic, so a caller who expected a single project can tell.

Errors

Both endpoints answer with the standard LangWatch error envelope and a real HTTP status. No wrapper sits around it. See Error Envelope. Where a failure has a fix, the envelope's meta carries the corrective fields for it. For example, FUNCTION_NOT_ALLOWED lists allowedFunctions.

StatuscodeWhen
400validation_errorThe request body failed validation.
400lwql_unparseableThe statement is not valid LangWatchQL.
400lwql_not_permittedThe statement is valid but calls something the policy withholds, for example a function outside the allowlist, or a LIMIT above 10,000 rows (meta.violations names it LIMIT_TOO_HIGH or LIMIT_REQUIRED_PER_BRANCH).
401missing_credentialsNo supported authentication credential was sent.
401invalid_credentialsThe API key is unknown, revoked, or has the wrong secret.
403api_key_permission_deniedThe key lacks the analytics:view permission on any project.
404project_not_foundThe body's projectId names a project the key cannot read with analytics:view, or one that does not exist. The two cases get the same answer.
413lwql_result_too_largeThe result body exceeds about 8,000,000 bytes.
422query_scan_limit_exceededThe statement is valid but would scan more data than the key allows.

Queryable views

Every view is a read-only projection over one ClickHouse or PostgreSQL table. GET /api/v1/query/schema is the live source of truth: the table below is a human-readable index of the same 47 views, grouped by what they're for.

How the catalog is built

Every ClickHouse table is a view by default: the catalog is derived from a generated columns manifest, so a new table shows up here automatically once it's catalogued, rather than needing a hand-written entry.

Two column families are gated rather than freely selectable: free-text carriers (captured input, captured output, tool output, log bodies) sit behind the output gate (input for a few views that separate the two), and billed/derived cost columns sit behind the costs gate. A gate's state comes from the project's privacy settings, never from the query. Selecting a gated column your key's project has not opened is refused outright with GATED_COLUMN, never silently dropped from the result.

Observability: traces, spans, logs

ViewDescriptionGatesGrainTime column
tracesOne row per trace, with its timing, token, cost and error rollups.input, output, costsone row per (TenantId, TraceId), latest version onlyOccurredAt
spansOne row per span, with its timing, status and attributes.input, output, costsone row per (TenantId, TraceId, SpanId), latest version onlyStartTime
span_metricsOne row per span with its timing, status, cost and the LangWatch facts dashboards group by, and no attribute map. Holds spans from the span_analytics floor on.costsone row per (TenantId, TraceId, SpanId); a duplicate span is countedStartTime
logsCanonical OpenTelemetry log records: requests, responses and provider events, correlated to their trace and span.input, outputone row per (TenantId, TraceId, TimeUnixMs, RecordId)TimeUnixMs
log_ingestion_usagePer-tenant log ingestion usage estimates.Noneone row per (OrganizationId, RecordId), latest version onlyAcceptedAt
metric_pointsIndividual metric data points with gauges, sums, histograms, and summariesoutputone row per (SeriesId, TimeUnixMs, PointId)TimeUnixMs
metric_series_definitionsMetric series definitions from OpenTelemetry: name, unit, attributes, kindoutputone row per SeriesIdLastSeenAt
metric_ingestion_usagePer-tenant metric ingestion usage estimatesNoneone row per (OrganizationId, PointId), latest version onlyAcceptedAt
objectsStored file objects: what was captured, its size and hash.Noneone row per idcreated_at
annotationsOne row per human annotation of a trace, with the reviewer's thumbs verdict.Noneone row per AnnotationIdCreatedAt
langy_conversation_messagesLangy conversation turns, one row per message.outputone row per (TenantId, ConversationId, MessageId)CreatedAt
langy_usage_eventsLangy usage telemetry: tool calls, outcomes and durations.Noneone row per (TenantId, OccurredAt, EventId)OccurredAt

Coding agents

ViewDescriptionGatesGrainTime column
coding_sessionsOne row per coding-agent session, with its shape, economics, git context and outcome. Deduplicated by session.input, costsone row per (TenantId, SessionId), latest version onlyStartedAt
coding_session_eventsOne row per coding-agent session event: model calls, compactions, rate limits, tool runs and more, in event order.costsone row per (TenantId, SessionId, TimeUnixMs, RecordId)TimeUnixMs
coding_trace_sessionsCorrelates a trace to the coding-agent session it belongs to.Noneone row per (TenantId, TraceId)OccurredAt
coding_tool_resultsOne row per coding-agent tool call, with the text it printed back to the agent.outputone row per (TenantId, TraceId, SpanId), latest version onlyStartTime
judgmentsOne row per Instant Eval run, trace and question, with the verdict the judge gave.Noneone row per (TenantId, RunId, TraceId, SpanId, QuestionId), latest version onlyCreatedAt

coding_tool_results.OutputText is what the tool printed back to the agent. Read it to answer "what did this failed tool call print":

example.sqlSQL
SELECT ToolName, OutputTextFROM coding_tool_resultsWHERE TenantId = '<project id>' AND Success = 0ORDER BY StartTime DESCLIMIT 20

Experiments & evaluations

ViewDescriptionGatesGrainTime column
evaluationsOne row per evaluation run, with its score and outcome.input, outputone row per (TenantId, EvaluationId), latest version onlyScheduledAt
simulationsOne row per simulation run, with its verdict and criteria.input, outputone row per (TenantId, ScenarioRunId), latest version onlyStartedAt
simulation_trace_metricsCost and latency metrics per simulated tracecostsone row per (ScenarioRunId, TraceId)OccurredAt
experimentsOne row per experiment, with its display name and kind.Noneone row per ExperimentIdCreatedAt
experiment_itemsIndividual item results within an experiment run with evaluationsinput, output, costsone row per (RunId, ProjectionId)OccurredAt
experiment_run_resultsExperiment run results: completion counts, cost, and aggregate scoresoutput, costsone row per (RunId, ExperimentId)StartedAt
dspy_optimizer_stepsDSPy optimizer steps with prompts, examples, and LLM call detailsoutput, costsone row per (ExperimentId, RunId, StepIndex)CreatedAt
batch_evaluationsOne row per offline batch evaluation of a dataset row, with its score, outcome and cost.costsone row per BatchEvaluationIdCreatedAt
test_suite_runsTest suite execution results with completion and pass countsNoneone row per (ScenarioSetId, BatchRunId)StartedAt

Note: "dataset" above refers to an evaluation dataset (rows a batch evaluation runs over). Everything else queryable through LangWatchQL is a view.

Metrics & rollups

Rollup views (_by_minute, _rollups) return finalised values only: figures for a bucket that was still open when the row was written are absent, not partial. A metric a caller wants without touching per-row data belongs here.

ViewDescriptionGatesGrainTime column
trace_metricsOne row per trace, time-sorted, carrying its metrics and the user, conversation, customer and origin dimensions. Count traces with uniqExact(TraceId).costsone row per (TenantId, OccurredAt, TraceId), latest version only; one row per trace wherever OccurredAt held stillOccurredAt
trace_metrics_by_minuteTrace and span metrics summed per minute. Every measure is a sum: divide by TraceCount for a per-trace average.costsone row per (TenantId, BucketStart), every measure summedBucketStart
model_usage_by_minuteSpan metrics summed per minute, per model and span type: span counts, costs and tokens.costsone merged row per (TenantId, BucketStart, Model, SpanType), every measure summedBucketStart
evaluation_metricsOne row per evaluation, its latest state, time-sorted, carrying its outcome, cost and the trace dimensions it inherited.costsone row per (TenantId, EvaluationId), latest version onlyOccurredAt
evaluation_metrics_by_minuteEvaluation outcomes summed per minute, per evaluator type and terminal status. Every measure is a sum: pass rate is PassCount over PassCount plus FailCount.costsone merged row per (TenantId, BucketStart, EvaluatorType, Status), every measure summedBucketStart
trace_evaluation_metricsOne row per evaluation of a trace, its live outcome, carrying the evaluated trace's time, source and dimensions, so a read by the trace's period needs no join.Noneone row per (TenantId, TraceId, EvaluationId): each revision grouped with its retractions, kept while its signs sum above zeroOccurredAt
trace_evaluation_checksLive evaluations of traces counted per trace, evaluator and outcome, carrying the evaluated trace's time and source. Sum Evaluations to count evaluations.Noneone row per (TenantId, TraceId, OccurredAt, TraceOccurredAt, EvaluatorName, Passed, IsGuardrail, Source, TraceSource), Evaluations summedOccurredAt
metric_rollupsTime-bucketed rollups of a metric series: per-bucket min, max, sum, count and histogram buckets.Noneone row per (SeriesId, BucketStart)BucketStart
session_metricsPer-session time-series metrics with aggregate statisticsNoneone row per (SessionId, SeriesId)AsOf
simulation_metric_rollupsPer-trace simulation cost and latency, merged from the aggregating rollup: total cost and per-role cost and latency maps.costsone row per (TenantId, ScenarioRunId, TraceId), latest version onlyOccurredAt

Gateway & billing

ViewDescriptionGatesGrainTime column
gateway_budget_ledgerBudget ledger entries per request with token counts and spendcostsone row per (BudgetId, GatewayRequestId)OccurredAt
gateway_budget_totalsPer-scope budget totals, merged from the aggregating rollup: spend, token counts and request count per budget window.costsone row per (TenantId, Scope, ScopeId, Window, PeriodStart, BudgetId), latest version onlyPeriodStart
gateway_request_spendIndividual API request spend and reconciliation detailscosts, outputone row per GatewayRequestIdOccurredAt
billing_eventsBilling events for customer invoice generationNoneone row per DeduplicationKeyHashEventTimestamp

Governance & audit

Governance views are keyed by the organization's hidden internal_governance project. A key scoped to an ordinary project sees zero rows here, not an error and not a gate refusal, until the caller's project set includes the org-level governance project.

ViewDescriptionGatesGrainTime column
governance_cost_restatementsIndex of cost-rollup restatements, keyed by the org's internal_governance project; visible only to a caller whose project set includes it.costsone row per (TenantId, RestatementKey)TenantId
governance_daily_cost_rollupDaily cost rollups per tenant, provider and model, keyed by the org's internal_governance project; visible only to a caller whose project set includes it.costs, outputone row per (TenantId, Day, CostSource, IngestionSourceId, Provider, Model, AgentId, CurrencyCode, RawActorId)Day
governance_hourly_kpisHourly spend and token KPIs per source, keyed by the org's internal_governance project; visible only to a caller whose project set includes it.costsone row per (TenantId, SourceId, HourBucket, TraceId)HourBucket
governance_security_eventsRaw OCSF-shaped security events, keyed by the org's internal_governance project; visible only to a caller whose project set includes it.outputone row per (TenantId, EventId)EventTime

Automation firing history is not an analytics view. Read it per automation with GET /api/triggers/{id}/fires, langwatch trigger fires <id>, or the MCP tool platform_list_trigger_fires, each paged by cursor.

Legacy

Superseded by the canonical views above; kept for rolling-deployment reads and draining under their own TTL.

ViewDescriptionGatesGrainTime column
legacy_event_logLegacy append-only event log, superseded by the canonical fact tablesoutputone row per (AggregateType, AggregateId, IdempotencyKey)EventOccurredAt
legacy_log_recordsPre-canonical OpenTelemetry log record storage, superseded by log_records; retained for rolling-deployment reads and draining under its own TTL.outputone row per (TraceId, SpanId, ProjectionId), latest version onlyTimeUnixMs
legacy_metric_recordsPre-canonical OpenTelemetry metric record storage, superseded by the metric_data_points family; retained for rolling-deployment reads and draining under its own TTL.Noneone row per (TraceId, SpanId, MetricName, ProjectionId), latest version onlyTimeUnixMs

Entities & reference data

ViewDescriptionGatesGrainTime column
projectsThe caller's project, with its display name and slug.Noneone row per TenantIdCreatedAt
promptsOne row per prompt configuration, with the name its versions are known by.Noneone row per PromptIdCreatedAt
prompt_versionsOne row per version of a prompt, carrying the version number a trace records.Noneone row per PromptVersionIdCreatedAt

Application tables (PostgreSQL)

Every tenant-scoped table of the application database, derived from the schema. Organization- and team-scoped rows are counted once across the projects read, under the lowest project id. Secret material and person identifiers are never exposed; free-text and JSON bodies are gated on the content permissions.

ViewDescriptionGatesGrainTime column
agentsRows of the Agent table, one row per AgentId.outputone row per AgentIdCreatedAt
ai_tool_entriesOrg-scoped catalog of AI tools surfaced on the personal home portal (/me) and managed by org admins at /governance/tool-catalog.outputone row per (AiToolEntryId), counted once across the projects read, under the lowest project idCreatedAt
ai_tool_entry_departmentsPer-department scope binding for AiToolEntry.Noneone row per (AiToolEntryDepartmentId), counted once across the projects read, under the lowest project idNone
ai_tool_entry_teamsPer-team scope binding for AiToolEntry.Noneone row per (AiToolEntryTeamId), counted once across the projects read, under the lowest project idNone
analyticsRows of the Analytics table, one row per AnalyticsId.outputone row per AnalyticsIdCreatedAt
annotation_queue_itemsRows of the AnnotationQueueItem table, one row per AnnotationQueueItemId.Noneone row per AnnotationQueueItemIdCreatedAt
annotation_queue_scoresRows of the AnnotationQueueScores table, one row per (AnnotationQueueId, AnnotationScoreId), counted once across the projects read, under the lowest project id.Noneone row per (AnnotationQueueId, AnnotationScoreId), counted once across the projects read, under the lowest project idNone
annotation_queuesRows of the AnnotationQueue table, one row per AnnotationQueueId.outputone row per AnnotationQueueIdCreatedAt
annotation_scoresRows of the AnnotationScore table, one row per AnnotationScoreId.outputone row per AnnotationScoreIdCreatedAt
anomaly_alertsPersisted anomaly detection.output, costsone row per (AnomalyAlertId), counted once across the projects read, under the lowest project idTriggerWindowStart
anomaly_rulesAdmin-defined anomaly detection rule.outputone row per (AnomalyRuleId), counted once across the projects read, under the lowest project idCreatedAt
costsRows of the Cost table, one row per CostId.costs, outputone row per CostIdCreatedAt
custom_graphsRows of the CustomGraph table, one row per CustomGraphId. Rows placed on a dashboard set to Only me are not queryable, and dashboard widgets are in dashboard_widgets.outputone row per CustomGraphIdCreatedAt
custom_llm_model_costsRows of the CustomLLMModelCost table, one row per CustomLLMModelCostId.costs, outputone row per CustomLLMModelCostIdCreatedAt
dashboard_widgetsOne row per widget in the Dashboards area: its React source and named LangWatchQL queries, and where it sits on its board. Widgets placed on a dashboard set to Only me are not queryable.outputone row per DashboardWidgetIdCreatedAt
dashboardsOne row per Analytics Reports board. Dashboards set to Only me are not queryable, and a board only the Dashboards area holds is in dashboards_v2.Noneone row per DashboardIdCreatedAt
dashboards_v2One row per board in the Dashboards area. A board made before Dashboards and Analytics Reports split kept its id, so it can be in dashboards too. Dashboards set to Only me are not queryable.Noneone row per DashboardIdCreatedAt
data_privacy_policiesRows of the DataPrivacyPolicy table, one row per (DataPrivacyPolicyId), counted once across the projects read, under the lowest project id.outputone row per (DataPrivacyPolicyId), counted once across the projects read, under the lowest project idCreatedAt
dataset_recordsRows of the DatasetRecord table, one row per DatasetRecordId.outputone row per DatasetRecordIdCreatedAt
datasetsRows of the Dataset table, one row per DatasetId.outputone row per DatasetIdCreatedAt
department_membership_historiesOne dated person → department link.Noneone row per (DepartmentMembershipHistoryId), counted once across the projects read, under the lowest project idCreatedAt
departmentsA department is a single-valued accounting dimension, separate from RBAC, for rolling up AI spend by org unit (Engineering, Marketing,...).Noneone row per (DepartmentId), counted once across the projects read, under the lowest project idCreatedAt
discovered_agentsA non-human actor (a bot, agent or automation) discovered from a connected source, with the provider-native metadata the source published.outputone row per (DiscoveredAgentId), counted once across the projects read, under the lowest project idCreatedAt
discovered_personsA name-text seen on a provider's cost or audit rows: "the provider told us someone called m.silva exists".output, costsone row per (DiscoveredPersonId), counted once across the projects read, under the lowest project idCreatedAt
email_suppressionsRows of the EmailSuppression table, one row per EmailSuppressionId.outputone row per EmailSuppressionIdCreatedAt
erased_identifier_suppressionsHashes of erased identifiers - the do-not-reimport list.Noneone row per (ErasedIdentifierSuppressionId), counted once across the projects read, under the lowest project idErasedAt
evaluatorsRows of the Evaluator table, one row per EvaluatorId.outputone row per EvaluatorIdCreatedAt
experiment_versionsRows of the ExperimentVersion table, one row per ExperimentVersionId.outputone row per ExperimentVersionIdCreatedAt
gateway_budget_bucket_boundariesRows of the GatewayBudgetBucketBoundary table, one row per (GatewayBudgetBucketBoundaryId), counted once across the projects read, under the lowest project id.Noneone row per (GatewayBudgetBucketBoundaryId), counted once across the projects read, under the lowest project idCreatedAt
gateway_budget_ledgersRows of the GatewayBudgetLedger table, one row per (GatewayBudgetLedgerId), counted once across the projects read, under the lowest project id.costsone row per (GatewayBudgetLedgerId), counted once across the projects read, under the lowest project idOccurredAt
gateway_budgetsRows of the GatewayBudget table, one row per (GatewayBudgetId), counted once across the projects read, under the lowest project id.output, costsone row per (GatewayBudgetId), counted once across the projects read, under the lowest project idCreatedAt
gateway_cache_rulesRows of the GatewayCacheRule table, one row per (GatewayCacheRuleId), counted once across the projects read, under the lowest project id.outputone row per (GatewayCacheRuleId), counted once across the projects read, under the lowest project idCreatedAt
gateway_change_eventsRows of the GatewayChangeEvent table, one row per Revision.outputone row per RevisionCreatedAt
gateway_guardrailsRows of the GatewayGuardrail table, one row per GatewayGuardrailId.outputone row per GatewayGuardrailIdCreatedAt
gateway_realtime_sessionsRows of the GatewayRealtimeSession table, one row per GatewayRealtimeSessionId.output, costsone row per GatewayRealtimeSessionIdCreatedAt
github_branch_pull_request_checksThe per-branch bookkeeping behind pull-request mapping: when a branch was last looked up on GitHub, how many pull requests it resolved to, and when it may be asked about again.outputone row per (GithubBranchPullRequestCheckId), counted once across the projects read, under the lowest project idCreatedAt
github_installationsThe organization's GitHub connection: a GitHub App installation mapped to a LangWatch organization.output, costsone row per (GithubInstallationId), counted once across the projects read, under the lowest project idCreatedAt
github_pull_requestsA pull request discovered through the organization's GitHub connection and mapped to the branch it was opened from, so a coding-agent session that knows only its branch can name the pull request it produced.output, inputone row per (GithubPullRequestId), counted once across the projects read, under the lowest project idCreatedAt
governance_tenant_historiesEvery tenant id this organization has ever written governance rows under, appended on first use and never pruned.Noneone row per (GovernanceTenantHistoryId), counted once across the projects read, under the lowest project idFirstUsedAt
identity_match_suggestionsMatch candidates a background job computed and a human has yet to confirm.Noneone row per (IdentityMatchSuggestionId), counted once across the projects read, under the lowest project idComputedAt
identity_matchesA dated link from an external account to a platform user, opened when the match holds and closed when it stops being true.Noneone row per (IdentityMatchId), counted once across the projects read, under the lowest project idCreatedAt
ingestion_pull_run_projectionsRebuildable per-source pull checkpoint and operator-facing run status.outputone row per IngestionPullRunProjectionIdCreatedAt
ingestion_sourcesPer-platform fleet configuration that connects a closed SaaS product's audit / OTel / S3 stream to LangWatch's Activity Monitor.output, costsone row per (IngestionSourceId), counted once across the projects read, under the lowest project idCreatedAt
ingestion_templatesAdmin/platform-curated catalog row for upstream OTLP normalization.outputone row per (IngestionTemplateId), counted once across the projects read, under the lowest project idCreatedAt
langy_active_turnsPostgres-authoritative one-turn admission for a conversation. Shared Langy conversations only; a member's private conversations are not queryable.outputone row per LangyActiveTurnIdCreatedAt
langy_conversation_projectionsRebuildable operational state folded from Langy's canonical event stream. Shared Langy conversations only; a member's private conversations are not queryable.input, outputone row per LangyConversationProjectionIdCreatedAt
langy_conversation_turn_projectionsRebuildable per-turn operational render document. Shared Langy conversations only; a member's private conversations are not queryable.outputone row per LangyConversationTurnProjectionIdCreatedAt
langy_message_projectionsRebuildable operational message fact. Shared Langy conversations only; a member's private conversations are not queryable.outputone row per LangyMessageProjectionIdCreatedAt
langy_turn_requestsDurable idempotency receipt for one logical Langy send. Shared Langy conversations only; a member's private conversations are not queryable.outputone row per LangyTurnRequestIdCreatedAt
model_default_config_scopesRows of the ModelDefaultConfigScope table, one row per (ModelDefaultConfigScopeId), counted once across the projects read, under the lowest project id.Noneone row per (ModelDefaultConfigScopeId), counted once across the projects read, under the lowest project idCreatedAt
model_default_configsRows of the ModelDefaultConfig table, one row per (ModelDefaultConfigId), counted once across the projects read, under the lowest project id.outputone row per (ModelDefaultConfigId), counted once across the projects read, under the lowest project idCreatedAt
model_provider_scopesRows of the ModelProviderScope table, one row per (ModelProviderScopeId), counted once across the projects read, under the lowest project id.Noneone row per (ModelProviderScopeId), counted once across the projects read, under the lowest project idCreatedAt
model_providersRows of the ModelProvider table, one row per (ModelProviderId), counted once across the projects read, under the lowest project id.outputone row per (ModelProviderId), counted once across the projects read, under the lowest project idCreatedAt
monitorsRows of the Monitor table, one row per MonitorId.outputone row per MonitorIdCreatedAt
notificationsRows of the Notification table, one row per NotificationId.outputone row per NotificationIdCreatedAt
pinned_tracesRows of the PinnedTrace table, one row per PinnedTraceId.outputone row per PinnedTraceIdCreatedAt
process_manager_inboxesIdempotency marker for a source event consumed by a process definition.Noneone row per ProcessManagerInboxIdConsumedAt
process_manager_instancesDurable state for a long-running event-sourced process.outputone row per ProcessManagerInstanceIdNextWakeAt
process_manager_outbox_attemptsOne row per failed outbox delivery attempt, so the table grows with delivery trouble rather than with traffic.outputone row per ProcessManagerOutboxAttemptIdOccurredAt
process_manager_outboxesTransactional intents emitted by a durable process transition.outputone row per ProcessManagerOutboxIdCreatedAt
prompt_tag_assignmentsRows of the PromptTagAssignment table, one row per PromptTagAssignmentId.Noneone row per PromptTagAssignmentIdCreatedAt
prompt_tagsRows of the PromptTag table, one row per (PromptTagId), counted once across the projects read, under the lowest project id.Noneone row per (PromptTagId), counted once across the projects read, under the lowest project idCreatedAt
retention_policiesRows of the RetentionPolicy table, one row per (RetentionPolicyId), counted once across the projects read, under the lowest project id.outputone row per (RetentionPolicyId), counted once across the projects read, under the lowest project idCreatedAt
routing_policiesRows of the RoutingPolicy table, one row per (RoutingPolicyId), counted once across the projects read, under the lowest project id.outputone row per (RoutingPolicyId), counted once across the projects read, under the lowest project idCreatedAt
routing_policy_scopesRows of the RoutingPolicyScope table, one row per (RoutingPolicyScopeId), counted once across the projects read, under the lowest project id.Noneone row per (RoutingPolicyScopeId), counted once across the projects read, under the lowest project idCreatedAt
saved_viewsRows of the SavedView table, one row per SavedViewId.outputone row per SavedViewIdCreatedAt
scenario_versionsRows of the ScenarioVersion table, one row per ScenarioVersionId.outputone row per ScenarioVersionIdCreatedAt
scenariosRows of the Scenario table, one row per ScenarioId.outputone row per ScenarioIdCreatedAt
scheduled_jobsRows of the ScheduledJob table, one row per ScheduledJobId.outputone row per ScheduledJobIdCreatedAt
share_linksRows of the ShareLink table, one row per ShareLinkId.Noneone row per ShareLinkIdCreatedAt
simulation_suitesRows of the SimulationSuite table, one row per SimulationSuiteId.outputone row per SimulationSuiteIdCreatedAt
topic_clustering_run_history_projectionsPer-project topic clustering run history (audit read model).outputone row per TopicClusteringRunHistoryProjectionIdCreatedAt
topic_clustering_run_projectionsPer-project topic clustering run status: the rebuildable operational read model behind the settings page.outputone row per TopicClusteringRunProjectionIdCreatedAt
topic_model_projectionsCursor row for the topic-model projection.Noneone row per TopicModelProjectionIdCreatedAt
topicsOne row per topic, with the name a trace's TopicId resolves to.Noneone row per TopicIdCreatedAt
trace_edit_overlaysRows of the TraceEditOverlay table, one row per TraceEditOverlayId.outputone row per TraceEditOverlayIdCreatedAt
trigger_sentsRows of the TriggerSent table, one row per TriggerSentId.Noneone row per TriggerSentIdCreatedAt
triggersRows of the Trigger table, one row per TriggerId.outputone row per TriggerIdCreatedAt
virtual_key_scopesRows of the VirtualKeyScope table, one row per (VirtualKeyScopeId), counted once across the projects read, under the lowest project id.Noneone row per (VirtualKeyScopeId), counted once across the projects read, under the lowest project idCreatedAt
virtual_keysRows of the VirtualKey table, one row per (VirtualKeyId), counted once across the projects read, under the lowest project id.outputone row per (VirtualKeyId), counted once across the projects read, under the lowest project idCreatedAt
webhook_endpoint_deliveriesThe per-ATTEMPT delivery log for BOTH webhook channels: the endpoints platform's batches and the automations channel's trigger fires.outputone row per WebhookEndpointDeliveryIdCreatedAt
workflow_versionsRows of the WorkflowVersion table, one row per WorkflowVersionId.outputone row per WorkflowVersionIdCreatedAt
workflowsRows of the Workflow table, one row per WorkflowId.outputone row per WorkflowIdCreatedAt

Tables intentionally left out

A table off the catalog above is always a recorded decision, never an oversight: a coverage guard fails the build until every ClickHouse table is either catalogued or given a reason here:

TableReason
lwql_api_key_tenant_mapAccess-control plumbing, not customer telemetry: holds key hashes the row policy reads to self-filter; the policy already scopes it, so exposing it would leak the isolation mechanism for no customer benefit.
goose_db_versionThe goose migration-version table, engine-internal tooling state, no tenant column at all.
Any table ending in _mv, or naming a .inner targetMaterialised-view internals: engine plumbing, not a table a caller would query; its data is already exposed through the table it feeds.

Supported functions

A query may call only the functions on the allowlist below. GET /api/v1/query/schema serves the same list under its functions field, so an agent can read it back at run time, and a FUNCTION_NOT_ALLOWED refusal carries it under allowedFunctions so a rejected query can be fixed without another round trip. Combinator forms of the listed aggregates, such as countIf, are also accepted.

  • abs, addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, and
  • any, anyLast, argMax, argMin, arrayAll, arrayAvg, arrayConcat, arrayCount, arrayDistinct, arrayElement
  • arrayEnumerate, arrayExists, arrayFilter, arrayFirst, arrayFirstIndex, arrayJoin, arrayLast, arrayMap, arrayMax, arrayMin
  • arrayReverseSort, arraySlice, arraySort, arrayStringConcat, arraySum, arrayUniq, assumeNotNull, avg, caseWithExpression, caseWithoutExpression
  • CAST, ceil, ceiling, cityHash64, coalesce, concat, concatWithSeparator, count, date_trunc, dateDiff
  • dateTrunc, dense_rank, divide, empty, endsWith, equals, exists, exp, extract, extractAll
  • first_value, floor, formatDateTime, fromUnixTimestamp, globalIn, globalNotIn, greater, greaterOrEquals, greatest, groupArray
  • groupUniqArray, has, hasAll, hasAny, if, ifNull, ilike, in, indexOf, intDiv
  • intDivOrZero, isDistinctFrom, isNotDistinctFrom, isNotNull, isNull, isValidJSON, JSONExtract, JSONExtractArrayRaw, JSONExtractBool, JSONExtractFloat
  • JSONExtractInt, JSONExtractKeys, JSONExtractKeysAndValues, JSONExtractRaw, JSONExtractString, JSONExtractUInt, JSONHas, JSONLength, JSONType, lagInFrame
  • lambda, last_value, leadInFrame, least, left, length, lengthUTF8, less, lessOrEquals, like
  • ln, log, log10, log2, lower, lowerUTF8, map, mapContains, mapFilter, mapKeys
  • mapValues, match, max, median, medianExact, min, minus, modulo, moduloOrZero, multiIf
  • multiply, negate, not, notEmpty, notEquals, notILike, notIn, notLike, now, now64
  • nth_value, ntile, nullIf, or, plus, position, positionCaseInsensitive, pow, power, quantile
  • quantileExact, quantiles, quantilesExact, quantilesTDigest, quantilesTiming, quantileTDigest, quantileTiming, rank, replaceAll, replaceOne
  • replaceRegexpAll, replaceRegexpOne, right, round, row_number, sign, simpleJSONExtractBool, simpleJSONExtractFloat, simpleJSONExtractInt, simpleJSONExtractString
  • simpleJSONExtractUInt, simpleJSONHas, sipHash128, splitByChar, splitByString, sqrt, startsWith, stddevPop, stddevSamp, substring
  • substringUTF8, subtractDays, subtractHours, subtractMinutes, subtractMonths, subtractQuarters, subtractSeconds, subtractWeeks, subtractYears, sum
  • toBool, toDate, toDate32, toDate32OrDefault, toDate32OrNull, toDate32OrZero, toDateOrDefault, toDateOrNull, toDateOrZero, toDateTime
  • toDateTime64, toDateTime64OrDefault, toDateTime64OrNull, toDateTime64OrZero, toDateTimeOrDefault, toDateTimeOrNull, toDateTimeOrZero, today, toDayOfMonth, toDayOfWeek
  • toDayOfYear, toDecimal128, toDecimal128OrDefault, toDecimal128OrNull, toDecimal128OrZero, toDecimal256, toDecimal256OrDefault, toDecimal256OrNull, toDecimal256OrZero, toDecimal32
  • toDecimal32OrDefault, toDecimal32OrNull, toDecimal32OrZero, toDecimal64, toDecimal64OrDefault, toDecimal64OrNull, toDecimal64OrZero, toFloat32, toFloat32OrDefault, toFloat32OrNull
  • toFloat32OrZero, toFloat64, toFloat64OrDefault, toFloat64OrNull, toFloat64OrZero, toHour, toInt128, toInt128OrDefault, toInt128OrNull, toInt128OrZero
  • toInt16, toInt16OrDefault, toInt16OrNull, toInt16OrZero, toInt256, toInt256OrDefault, toInt256OrNull, toInt256OrZero, toInt32, toInt32OrDefault
  • toInt32OrNull, toInt32OrZero, toInt64, toInt64OrDefault, toInt64OrNull, toInt64OrZero, toInt8, toInt8OrDefault, toInt8OrNull, toInt8OrZero
  • toIntervalDay, toIntervalHour, toIntervalMinute, toIntervalMonth, toIntervalQuarter, toIntervalSecond, toIntervalWeek, toIntervalYear, toISOWeek, toLastDayOfMonth
  • toMinute, toMonday, toMonth, topK, toQuarter, toSecond, toStartOfDay, toStartOfFifteenMinutes, toStartOfFiveMinutes, toStartOfHour
  • toStartOfInterval, toStartOfISOWeek, toStartOfMinute, toStartOfMonth, toStartOfQuarter, toStartOfSecond, toStartOfTenMinutes, toStartOfWeek, toStartOfYear, toString
  • toTimeZone, toUInt128, toUInt128OrDefault, toUInt128OrNull, toUInt128OrZero, toUInt16, toUInt16OrDefault, toUInt16OrNull, toUInt16OrZero, toUInt256
  • toUInt256OrDefault, toUInt256OrNull, toUInt256OrZero, toUInt32, toUInt32OrDefault, toUInt32OrNull, toUInt32OrZero, toUInt64, toUInt64OrDefault, toUInt64OrNull
  • toUInt64OrZero, toUInt8, toUInt8OrDefault, toUInt8OrNull, toUInt8OrZero, toUnixTimestamp, toUUID, toUUIDOrDefault, toUUIDOrNull, toUUIDOrZero
  • toWeek, toYear, trim, trimBoth, trimLeft, trimRight, trunc, truncate, tuple, tupleElement
  • uniq, uniqCombined, uniqExact, upper, upperUTF8, varPop, varSamp, yesterday

Response ceilings

A statement that names no LIMIT is capped at 10,000 rows: that LIMIT is appended before the query runs, so a large answer comes back as one page rather than a stream. To read the rest, page with LIMIT/OFFSET and an ORDER BY.

A statement whose own LIMIT asks for more than 10,000 rows is refused with LIMIT_TOO_HIGH before it runs. When using UNION, every top-level branch must carry its own LIMIT clause of 10,000 rows or fewer, or the query is refused with LIMIT_REQUIRED_PER_BRANCH. A result whose body exceeds about 8,000,000 bytes is refused outright with lwql_result_too_large. Select fewer columns or a smaller LIMIT to bring it under the cap.

Documentation