---
title: "Run a financial report"
method: POST
path: "/analytics/reports/{key}/query"
tags: ["Analytics"]
---

# Run a financial report

`POST /analytics/reports/{key}/query`

## Request

- Base URL: `https://us.api.flexprice.io/v1`
- URL: `https://us.api.flexprice.io/v1/analytics/reports/{key}/query`
- Auth: API key in header `x-api-key`

Runs the report identified by key. range is an absolute YYYY-MM-DD..YYYY-MM-DD (end exclusive) or last_N_days. compare is previous_period or previous_year.

## Path parameters

- `key` string, required

## Request body

- ReportQueryRequest
  - `compare` 'previous_period' | 'previous_year'
  - `currency` string
  - `dimensions` string[]
  - `filters` ReportFilter[]
    - `field` string
    - `op` 'eq' | 'in'
    - `value` string[]
  - `grain` 'day' | 'week' | 'month'
  - `limit` integer
  - `offset` integer
  - `range` string, required
  - `shape` 'timeseries' | 'breakdown' | 'scalar', required
  - `sort` ReportSort[]
    - `dir` 'asc' | 'desc'
    - `field` string

## Response `200`

OK

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

## Other responses

- `400`: Invalid request
- `403`: Reports not enabled
- `404`: Report not found
- `500`: Server error

## Changes

- **2026-10-27** `6415d4e95948`: 1 info
  - added the new optional request property `offset`
- **2026-10-26** `0df3981dc392`: 1 warning
  - removed the request property `offset`
- **2026-10-26** `c07bd1cc401b`: 1 warning
  - the `offset` request property's min was set to `0.00`
- **2026-10-26** `15da100971a2`: 1 info
  - added the new optional request property `offset`
- **2026-10-25** `4746c65d9396`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/analytics/reports/:key/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/e1348d61034c?raw)
