---
title: "List SQL queries in a report"
method: GET
path: "/v2/reports/{reportId}/queries"
tags: ["Reports"]
---

# List SQL queries in a report

`GET /v2/reports/{reportId}/queries`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/reports/{reportId}/queries`
- Auth: HTTP bearer

This endpoint retrieves a list of all SQL queries stored within a specific report. 

### Usage notes
- Retrieve the **reportId** by calling the [/v2/reports](https://help.sigmacomputing.com/reference/list-reports) endpoint.

### Usage scenarios
- **Audit and review:** Enables administrators and data governance teams to audit and review all the queries associated with a report for compliance and optimization.
- **Query optimization:** Allows users to identify and optimize potentially inefficient or slow queries to improve performance.

### Best practices
- Use pagination to manage large sets of queries efficiently, especially in reports with extensive data manipulation.
- Regularly review queries as part of data governance practices to ensure they remain up to date and perform optimally.

## Path parameters

- `reportId` string, required

## Query parameters

- `pageToken` string
- `pageSize` integer

## Response `200`

The response body.

- ReportsListReportQueriesResponse200
  - `entries` V2ReportsReportIdQueriesGetResponsesContentApplicationJsonSchemaEntriesItems[], required: Array of results returned by the endpoint
    - `elementId` string, required
    - `name` string
    - `sql` string
    - `error` string
  - `nextPageToken` string: A string that can be passed to the `pageToken` parameter in the next request to fetch the next page of results. Not present in the last page of results. **Must be treated as an opaque string.**

---

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