---
title: "Query analytics data"
method: POST
path: "/analytics/query"
tags: ["Analytics"]
---

# Query analytics data

`POST /analytics/query`

## Request

- Base URL: `https://localhost:8446/api/v2`
- URL: `https://localhost:8446/api/v2/analytics/query`
- Auth: API key in header `Authorization`

Executes query against analytics database and returns results.

## Request body

- object
  - `query` string, required: SQL query to execute. Only SELECT queries are allowed.
  - `limit` number: Maximum number of rows to return. Default value is 1000. Maximum allowed value is 10000.
  - `token` string: Continuation token.

## Response `200`

Successful response

- object
  - `meta` object: Columns metadata.
  - `meta.name` string: Column name.
  - `meta.type` string: Column type.
  - `rows` unknown[]: Query results. Each item in the array represents a row of the result. Row is an array of values.
    - unknown
  - `token` string: Continuation token for paginated queries. If present, it means there are more results to be fetched. The token should be used in the next request to fetch the next page of results.

## Other responses

- `default`: Error response. Depending on the error, either a 4xx or 5xx response status is returned.

---

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