---
title: "Query Db"
method: POST
path: "/insights/query-db"
tags: ["Insights"]
---

# Query Db

`POST /insights/query-db`

## Request

- Base URL: `https://api.chift.eu`
- URL: `https://api.chift.eu/insights/query-db`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/chift/apis/chift-api/docs/insights/query-db/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `x-chift-datalayer-max-staleness` string, nullable

## Request body

- CubeLoadQuery
  - `measures` string[]
  - `dimensions` string[]
  - `segments` string[]
  - `filters` union[]
    - union
      - CubeLeafFilter: Cube REST API leaf filter: member + operator + values.
        - `member` string, required
        - `operator` string, required
        - `values` string[], nullable
      - CubeAndFilter: Cube REST API logical AND filter.
        - `and` union[], required
          - union
            - CubeLeafFilter: Cube REST API leaf filter: member + operator + values.
              - …
            - CubeAndFilter (recursive)
            - CubeOrFilter: Cube REST API logical OR filter.
              - …
      - CubeOrFilter: Cube REST API logical OR filter.
        - `or` union[], required
          - union
            - CubeLeafFilter: Cube REST API leaf filter: member + operator + values.
              - …
            - CubeAndFilter: Cube REST API logical AND filter.
              - …
            - CubeOrFilter (recursive)
  - `timeDimensions` CubeTimeDimension[]
    - `dimension` string, required
    - `dateRange` union
      - string
      - string[]
    - `compareDateRange` array[], nullable
      - string[]
    - `granularity` string, nullable
  - `order` union
    - object
    - CubeOrderItem[]
      - `id` string, nullable
      - `member` string, nullable
      - `desc` boolean, nullable
      - `direction` 'asc' | 'desc', nullable
    - array[]
      - string[]
  - `limit` integer, nullable
  - `offset` integer, nullable
  - `timezone` string, nullable
  - `total` boolean, nullable
  - `renewQuery` boolean, nullable
  - `ungrouped` boolean, nullable

## Response `200`

Successful Response

- QueryResponse
  - `results` ExecutionResult[], required
    - `column` string, required
    - `title` string, nullable
    - `data` unknown[], required
      - unknown
    - `type` string, required
  - `meta` QueryMeta
    - `currency` string[], nullable
    - `monetary_measures` string[], nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-03** `020884969534`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/chift/apis/chift-api/changes/insights/query-db/post.md)

---

[API](https://skmtc.dev/chift/apis/chift-api.md) - [All operations](https://skmtc.dev/chift/apis/chift-api/llms.txt) - [OpenAPI document](https://skmtc.dev/chift/apis/chift-api/revisions/020884969534?raw)
