---
title: "Export Query (async)"
method: POST
path: "/data/projects/{projectId}/queries/{queryId}/exports"
tags: ["Data -- Exports"]
---

# Export Query (async)

`POST /data/projects/{projectId}/queries/{queryId}/exports`

## Request

- Base URL: `https://partner.peaka.studio/api/v1`
- URL: `https://partner.peaka.studio/api/v1/data/projects/{projectId}/queries/{queryId}/exports`
- Auth: HTTP bearer

Submits an async export of a saved query as CSV or JSONL. Returns immediately with a job id; poll the status endpoint for the download URLs.

## Path parameters

- `projectId` string, required
- `queryId` string, required

## Request body

- ExportRequest: Async export request. The job is accepted (202) and runs in the background; the result is downloaded via presigned URLs returned by the status endpoint.
  - `format` 'CSV' | 'JSONL': Output format
  - `limit` integer: Row limit; clamped to [1, 1000000]
  - `csvOptions` ExportCsvOptions: CSV formatting options (ignored for JSONL exports)
    - `delimiter` string: Field delimiter
    - `quoteChar` string: Quote character
    - `recordSeparator` string: Record separator
    - `includeHeader` boolean: Whether to emit a header row
    - `nullValue` string: Representation of NULL values
  - `includeSystemColumns` boolean: When false, Peaka system columns (_id, _version, …) are excluded. Cache plumbing columns (_q_*, _cache_*) are always dropped.
  - `columns` string[]: Explicit column selection; an unknown name yields 400. Omit to export all columns.
  - `compression` 'NONE' | 'GZIP': Output compression; with GZIP every artifact is a gzip stream carrying a .gz suffix

## Response `202`

Export job accepted

- ExportJobCreated: Acknowledgement returned when an export job is accepted
  - `id` string: Export job id
  - `status` string: Initial job status

---

[API](https://skmtc.dev/peaka/apis/peaka-gateway-api.md) · [All operations](https://skmtc.dev/peaka/apis/peaka-gateway-api/llms.txt) · [OpenAPI document](https://skmtc.dev/peaka/apis/peaka-gateway-api/revisions/e68b033a22d5?raw)
