Export Endpoints
The export endpoints allow query results to be exported in CSV, JSON, JSON Lines, and Parquet formats. Both synchronous and asynchronous export modes are supported. Served by QueryExportController at /v1/queries.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/queries/:executionId/export | Export synchronously |
| POST | /v1/queries/:executionId/export/async | Export asynchronously |
| GET | /v1/queries/exports/:exportId/progress | Get export progress |
| GET | /v1/queries/exports/:exportId/download | Download export file |
| DELETE | /v1/queries/exports/:exportId | Clean up export |
Export Formats
| Format | Content Type | Use Case |
|---|---|---|
CSV | text/csv | Spreadsheet import, data exchange |
JSON | application/json | API integration, structured data |
JSON_LINES | application/json | Streaming processing, line-by-line parsing |
PARQUET | application/octet-stream | Analytics tools, columnar storage |
POST /v1/queries/:executionId/export
Exports query results synchronously. Best for small to medium result sets.
{
"format": "CSV",
"includeHeaders": true,
"compression": "GZIP",
"maxRows": 100000
}Asynchronous Export
For large result sets, use the async endpoint:
POST /v1/queries/:executionId/export/asyncReturns 202 Accepted with an export ID. Poll the progress endpoint until status is COMPLETED:
GET /v1/queries/exports/:exportId/progress{
"executionId": "uuid",
"status": "COMPLETED",
"format": "PARQUET",
"fileName": "export-uuid.parquet",
"fileSize": 1048576,
"rowCount": 50000
}Downloading Results
GET /v1/queries/exports/:exportId/downloadReturns the file as a binary download with appropriate Content-Type and Content-Disposition headers. The export must be in COMPLETED status.
Cleanup
DELETE /v1/queries/exports/:exportIdRemoves the export file from storage and deletes the metadata record. Export files are also cleaned up automatically after a configurable retention period.