---
title: "Get unified queries with insights"
method: GET
path: "/api/v1/databricks/queries/unified"
tags: ["DATABRICKS", "Databricks", "Databricks Queries"]
---

# Get unified queries with insights

`GET /api/v1/databricks/queries/unified`

Get unified queries with computed insight tags.

Each query is automatically tagged with applicable insights:
- slow_query: Query duration >= 60 seconds
- disk_spill: Memory spill >= 1MB
- full_table_scan: Data read >= 1GB
- failed: Query failed to execute

## Query parameters

- `start_date` string, date, required — Start date
- `end_date` string, date — End date
- `workspace_id` string, nullable — Filter by single workspace ID (legacy URL pre-selection)
- `workspace_ids` string[], nullable — Filter by one or more workspace IDs (column multi-select)
- `warehouse_id` string[], nullable — Filter by one or more warehouse IDs (legacy column multi-select). Prefer ``compute_id`` for new FE bindings — it covers warehouse + cluster + pipeline in one parameter. Entries here are merged with any ``compute_id`` warehouse selections before the BE applies the filter.
- `compute_id` string[], nullable — Unified Compute filter: one or more ``{kind}:{id}`` selections from the dropdown, where ``kind`` is ``warehouse``, ``cluster``, or ``pipeline``. A mixed selection is ORed (rows of any selected kind match). Entries with an unknown ``kind`` or empty id are silently skipped so this stays forward-compatible if the FE adopts a new kind ahead of the BE.
- `insights` string[], nullable — Filter by insight tags (slow_query, disk_spill, full_table_scan, failed)
- `statement_type` string, nullable — Filter by statement type
- `user_name` string[], nullable — Filter by one or more user names. Single-value calls (e.g. the User-list drilldown URL ``?user_name=alice``) continue to work — FastAPI parses the single value as a one-element list and the BE applies the matching IN-clause filter. Multi-select dropdowns send ``?user_name=alice&user_name=bob``.
- `statement_ids` string[], nullable — Filter by one or more exact query (statement) IDs
- `page` integer — Page number (1-indexed)
- `page_size` integer — Number of items per page
- `sort_by` string — Column to sort by. Allowed: estimated_cost_usd, start_time, total_duration_ms, read_bytes, spilled_local_bytes, statement_type, user_name, warehouse_name, workspace_name.
- `sort_order` string — Sort order: 'asc' or 'desc'
- `navigationSource` string, nullable

## Headers

- `x-tenant` string, required

## Response `200`

Successful Response

- UnifiedQueriesResponse — Response for unified queries with insights.
  - `queries` UnifiedQueryRecord[], required
    - `statement_id` string, required
    - `statement_text` string, nullable
    - `statement_type` string, nullable
    - `execution_status` string, nullable
    - `start_time` string, date-time, nullable
    - `end_time` string, date-time, nullable
    - `total_duration_ms` integer, nullable
    - `read_bytes` integer, nullable
    - `spilled_local_bytes` integer, nullable
    - `workspace_id` string, nullable
    - `workspace_name` string, nullable
    - `warehouse_id` string, nullable
    - `cluster_id` string, nullable
    - `cluster_name` string, nullable
    - `warehouse_name` string, nullable
    - `warehouse_size` string, nullable
    - `pipeline_id` string, nullable
    - `pipeline_name` string, nullable
    - `job_id` string, nullable
    - `compute_display` string, nullable — Resolved compute label for the UI's Compute column. Priority: warehouse_name -> warehouse_id -> cluster_name -> cluster_id -> 'DLT Pipeline: <pipeline_name|pipeline_id>' -> 'Job: <job_id>' -> '-'. Composed in SQL.
    - `dbus` number, nullable — DBUs consumed by this query
    - `estimated_cost_usd` number, nullable — Estimated cost in USD from dbx_query_cost table
    - `user_name` string, nullable
    - `error_message` string, nullable
    - `insights` string[] — List of insight tags (slow_query, disk_spill, full_table_scan, failed)
  - `total_count` integer, required — Total number of queries matching filters
  - `page` integer — Current page number
  - `page_size` integer — Number of items per page
  - `total_pages` integer — Total number of pages

## Other responses

- `403` — Not authorized
- `404` — No ClickHouse database configured
- `422` — Validation Error

---

[API](https://skmtc.net/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.net/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myaltimate/fastapi/versions/aab3fe5c9f05/schema)
