Execute a SQL query on the organization’s data warehouse and return presigned URLs to download results.
This endpoint executes SQL queries on the organization’s data warehouse (AWS Athena or GCP BigQuery) and returns presigned URLs for downloading the results directly from cloud storage (S3 or GCS).
Important: Customer data never transits through Nekt servers. Results are stored in the organization’s cloud storage and accessed via time-limited presigned URLs (1 hour expiration).
Requirements:
cloud_setup_completed = True)Cloud Provider Support:
Output Formats:
csv: CSV format (default) - supports simple data types onlyparquet: Parquet format - supports all data types including complex types (arrays, structs, etc.)Limitations:
Example Request:
{
"sql": "SELECT * FROM my_table LIMIT 100",
"mode": "parquet",
"mode_options": {"compression": "SNAPPY"}
}
Example Response:
{
"state": "SUCCEEDED",
"presigned_urls": [
"https://storage.googleapis.com/bucket/query-20251119-154427-123456-000000000000.parquet?..."
],
"data_scanned_in_bytes": 11250,
"execution_time_in_millis": 408
}
API Key authentication. Format: 'x-api-key: api_key'
Serializer for SQL query execution request.
SQL query string to execute using standard SQL syntax (AWS Athena or GCP BigQuery depending on your organization's cloud provider)
Output format for query results. Options: 'csv' (default, universal compatibility) or 'parquet' (better compression and performance, recommended for large datasets)
csv - csvparquet - parquetcsv, parquet Additional options for the output format. Available options depend on your organization's cloud provider and selected mode:
AWS Organizations:
GCP Organizations:
Example: {'compression': 'SNAPPY'} or {'delimiter': ';', 'header': true, 'compression': 'GZIP'}
Serializer for SQL query execution response.
Query execution state
SUCCEEDED - SUCCEEDEDFAILED - FAILEDCANCELLED - CANCELLEDRUNNING - RUNNINGSUCCEEDED, FAILED, CANCELLED, RUNNING List of presigned URLs to download result files (1 hour expiration)
Amount of data scanned by the query (if succeeded)
Query execution time in milliseconds (if succeeded)
Error message (if failed)