---
title: "Execute an Analytics query"
method: POST
path: "/apps/{appId}/query"
---

# Execute an Analytics query

`POST /apps/{appId}/query`

Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query.

## Path parameters

- `appId` string, required

## Request body

- QueryBody — The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)
  - `query` string, required — The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)
  - `timespan` string — Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.
  - `applications` string[] — Application IDs to include in cross-application queries.

## Response `200`

Successful response

- QueryResults — Contains the tables, columns & rows resulting from a query.
  - `tables` Table[], required — The list of tables, columns and rows.
    - `name` string, required — The name of the table.
    - `columns` Column[], required — The list of columns in this table.
      - `name` string — The name of this column.
      - `type` string — The data type of this column.
    - `rows` array[], required — The resulting rows from this query.
      - string[]

## Other responses

- `default` — An error response object.

## Changes

- **2026-07-13** (2018-04-20) `5ba59b0ed852` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/azure/apis/applicationinsights-insights/changes/apps/:appId/query/post.md)

---

[API](https://skmtc.dev/azure/apis/applicationinsights-insights.md) · [All operations](https://skmtc.dev/azure/apis/applicationinsights-insights/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/applicationinsights-insights/revisions/5ba59b0ed852/schema)
