---
title: "Get query cost trends by user"
method: GET
path: "/api/v1/databricks/queries/trends/cost-by-user"
tags: ["DATABRICKS", "Databricks", "Databricks Queries"]
---

# Get query cost trends by user

`GET /api/v1/databricks/queries/trends/cost-by-user`

Get query cost trends over time broken down by user.

## Query parameters

- `start_date` string, date, required — Start date
- `end_date` string, date — End date
- `granularity` string — Time granularity: 'day', 'week', or 'month'
- `workspace_id` string, nullable — Filter by workspace ID
- `top_n` integer — Number of top users to show
- `navigationSource` string, nullable

## Headers

- `x-tenant` string, required

## Response `200`

Successful Response

- QueryCostTrendsByUserResponse — Response for query cost trends broken down by user.
  - `trends` QueryCostTrendByUserPoint[], required
    - `period` string, required
    - `user_name` string, required
    - `estimated_cost_usd` number
  - `granularity` string, required
  - `users` string[] — List of unique users in the data (for chart legend)

## 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)
