---
title: "Run a saved widget query"
method: POST
path: "/v1/private/dashboards/{dashboardId}/widgets/{widgetId}/query"
tags: ["Dashboards"]
---

# Run a saved widget query

`POST /v1/private/dashboards/{dashboardId}/widgets/{widgetId}/query`

## Request

- Base URL: `http://localhost:5173/api`
- URL: `http://localhost:5173/api/v1/private/dashboards/{dashboardId}/widgets/{widgetId}/query`
- Auth: none declared

Runs the query saved on an Ollie chart widget of this dashboard over the given date range and returns its rows. The query is read from the saved widget; the request carries no SQL. Returns 501 when Ollie or Custom Charts is not enabled for the workspace.

## Path parameters

- `dashboardId` string, uuid, required
- `widgetId` string, required

## Request body

- DashboardWidgetQueryRequest
  - `interval_start` string, date-time: Start of the date range, bound to {{window_start}} in the dashboard saved query. Omit for all time.
  - `interval_end` string, date-time: End of the date range, bound to {{window_end}} in the dashboard saved query. Omit for now.

## Response `200`

Query results

- AnalyticsQueryResponse
  - `results` JsonNode[]

## Other responses

- `400`: Bad Request
- `404`: Dashboard not found, or the widget has no dashboard saved query
- `422`: Unprocessable Content
- `429`: Too many queries are running; retry after the Retry-After delay
- `501`: Ollie or Custom Charts is not enabled for this workspace

## Changes

- **2026-10-14** `1becf60bcc5e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/comet-ml/apis/opik-rest-api/changes/v1/private/dashboards/:dashboardId/widgets/:widgetId/query/post.md)

---

[API](https://skmtc.dev/comet-ml/apis/opik-rest-api.md) - [All operations](https://skmtc.dev/comet-ml/apis/opik-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/comet-ml/apis/opik-rest-api/revisions/0067fada8962?raw)
