> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export query runs

> Download the matching history as a CSV file.

`GET /api/v1/query-history/export`

Download the matching history as a CSV file.

## Access

[Request a workspace OAuth token](https://docs.e6data.com/api-reference/workspace-oauth-2-0/post-oauth2-token.md#request) for the workspace that owns the resource. If your workspace uses OAuth scopes for API access, request `query_engine.history:read`. If your admin confirms that workspace permissions are active for management API calls, omit the `scope` field for this call.

Use a workspace that has Query History enabled.

## Request

Query: start, end and filters select the runs. columns is a comma-separated list. The example uses columns=query\_id,status. The query ID is always included.

No request body.

### Example request

Set `WORKSPACE_URL` to the same HTTPS workspace origin and `ACCESS_TOKEN` to the access token from that workspace.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --proto '=https' --silent --show-error --fail-with-body \
  --request GET \
  --header @- \
  "$WORKSPACE_URL/api/v1/query-history/export?columns=query_id,status" <<< "Authorization: Bearer $ACCESS_TOKEN"
```

## Response

HTTP `200`. Content type: `text/csv`.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Query ID,Status
11111111-2222-4333-8444-555555555555,SUCCESS
```

Omitting columns includes all export columns. Check the CSV before sharing it.

## Troubleshooting

For `401`, check the workspace URL and token expiry. For `403`, ask your admin to check the machine client’s access to this operation and resource. In a scope-based workspace, also check the scope on the token. [Troubleshoot the token or request](https://docs.e6data.com/api-reference/list-clusters-with-oauth.md#troubleshoot-a-request).

## Related guides

[Workspace management guide](https://docs.e6data.com/platform/automate/clusters-catalogs-schedules-policies.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.