---
title: "Run analytics query"
method: POST
path: "/analytics/query"
tags: ["Analytics"]
---

# Run analytics query

`POST /analytics/query`

Runs a read-only ClickHouse SQL query against the current project's analytics dataset.

## Request body

- object
  - `include_all_branches` boolean — Reserved for future branch-wide analytics queries. Must be false.
  - `query` string, required — A read-only ClickHouse SQL query.
  - `params` object — ClickHouse query parameters referenced by the query.
  - `timeout_ms` integer — Maximum query execution time in milliseconds. The effective timeout is also capped by the project's plan.

## Response `200`

Successful response

- object
  - `result` object[], required — Query result rows as plain JSON objects.
  - `query_id` string, required — The ClickHouse query ID. Use it to fetch query timing stats.

## Changes

> 24 revisions in range; 5 could not be searched.

- **2026-07-02** `a48bc483b897` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hexclave/apis/hexclave-rest-api-2/changes/analytics/query/post.md)

---

[API](https://skmtc.dev/hexclave/apis/hexclave-rest-api-2.md) · [All operations](https://skmtc.dev/hexclave/apis/hexclave-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hexclave/hexclave-rest-api-2/revisions/897c83038ab2/schema)
