---
title: "Download an exported file"
method: GET
path: "/v2/query/{queryId}/download"
tags: ["Query"]
---

# Download an exported file

`GET /v2/query/{queryId}/download`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/query/{queryId}/download`
- Auth: HTTP bearer

After making a request to the [/v2/workbooks/{workbookId}/export](https://help.sigmacomputing.com/reference/export-workbook) or [/v2/reports/{reportId}/export](https://help.sigmacomputing.com/reference/export-report) endpoint, you can use this endpoint to download the exported file using the queryId returned in the response.

### Usage notes

- This endpoint is rate limited to 400 requests per minute.
- The export must be ready to download before you can download the results. The endpoint returns an error if the query is still processing or if the `queryId` is invalid or expired. Query results are typically available for a limited time, so make sure to download query results while they are available.
- Retrieve the **queryId** by making a request to the [/v2/workbooks/{workbookId}/export](https://help.sigmacomputing.com/reference/export-workbook) or [/v2/reports/{reportId}/export](https://help.sigmacomputing.com/reference/export-report) endpoint.
- Specify the file format when you make the export request. You cannot specify the file format when you download the file.

### Usage scenarios
- **Scheduled reporting**: Automate the downloading of reports generated on a scheduled basis.
- **Data analysis**: Retrieve large sets of data for local analysis in external tools not integrated directly with Sigma.

### Best practices
- Monitor the status of the export query before attempting a download to make sure it is ready. For a code example, see [Export to CSV with Date Range Parameters](https://help.sigmacomputing.com/recipes/workbook-export-to-csv-with-date-range-parameters).
- Handle errors gracefully in your application, providing users with clear messages regarding the status of their requested downloads.

## Path parameters

- `queryId` string, required

## Response `200`

The response body.

- string, binary

---

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