---
title: "List SQL queries in a workbook"
method: GET
path: "/v2/workbooks/{workbookId}/queries"
tags: ["Workbooks"]
---

# List SQL queries in a workbook

`GET /v2/workbooks/{workbookId}/queries`

## Request

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

This endpoint retrieves a list of all SQL queries stored within a specific workbook. It is useful for developers and analysts who need to review or audit the queries being used for data manipulation and reporting within the workbook.

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

### Usage scenarios
- **Audit and review:** Enables administrators and data governance teams to audit and review all the queries associated with a workbook 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 workbooks 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

- `workbookId` string, required

## Query parameters

- `page` string
- `limit` number, double

## Response `200`

The response body.

- WorkbooksListWorkbookQueriesResponse200
  - `entries` V2WorkbooksWorkbookIdQueriesGetResponsesContentApplicationJsonSchemaEntriesItems[], required
    - `elementId` string, required
    - `name` string
    - `sql` string
    - `error` string
  - `nextPage` string, nullable, required
  - `total` number, double

---

[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)
