---
title: "Query an analytics view"
method: POST
path: "/analytics/views/{id}/query"
tags: ["Analytics"]
---

# Query an analytics view

`POST /analytics/views/{id}/query`

Resolves the view's definition against the supplied variables and executes it.

## Path parameters

- `id` string, required

## Request body

- ViewQueryRequest
  - `variables` object

## Response `200`

OK

- AnalyticsQueryResult
  - `columns` AnalyticsColumn[]
    - `currency` string
    - `name` string
    - `role` 'dimension' | 'metric'
    - `type` 'string' | 'decimal' | 'datetime'
  - `meta` AnalyticsQueryMeta
    - `query_source` string
  - `rows` array[]
    - string[]

## Other responses

- `400` — Invalid request
- `404` — View not found
- `500` — Server error

## Changes

- **2026-09-21** `ca8fb37253e5` — 1 info
  - endpoint added
- **2026-09-18** `0fb60b40c570` — 1 breaking
  - api path removed without deprecation
- **2026-09-15** `cb3984fd3acb` — 2 breaking, 5 warning, 1 info
  - the `variables/additionalProperties/` request property type changed from `object` to `array`
  - the `rows/items/items/` response's property type changed from `object` to `string` for status `200`
  - added the new `datetime` enum value to the `columns/items/type` response property for the response status `200`
  - added the new `decimal` enum value to the `columns/items/type` response property for the response status `200`
  - …4 more
- **2026-09-14** `5f9d16cd8235` — 1 info
  - endpoint added
- **2026-09-14** `7b140458b57e` — 1 breaking
  - api path removed without deprecation

[Full history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/analytics/views/:id/query/post.md)

---

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