Skip to main content
POST
/
api
/
v1
/
sql-query
/
curl --request POST \
--url https://api.nekt.ai/api/v1/sql-query/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"sql": "SELECT * FROM \"nekt_raw\".\"customers\" LIMIT 100"
}'
{
"state": "SUCCEEDED",
"presigned_urls": [
"https://storage.googleapis.com/bucket/query-20251119-154427-123456-000000000000.parquet?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=..."
],
"data_scanned_in_bytes": 11250,
"execution_time_in_millis": 408
}
Security: Your data never transits through Nekt servers. Results are stored in your organization’s cloud storage and accessed via time-limited presigned URLs (1 hour expiration).

Authorizations

x-api-key
string
header
required

API Key authentication. Format: 'x-api-key: api_key'

Body

Serializer for SQL query execution request.

sql
string
required

SQL query string to execute using standard SQL syntax (AWS Athena or GCP BigQuery depending on your organization's cloud provider)

mode
enum<string>
default:csv

Output format for query results. Options: 'csv' (default, universal compatibility) or 'parquet' (better compression and performance, recommended for large datasets)

  • csv - csv
  • parquet - parquet
Available options:
csv,
parquet
mode_options
object

Additional options for the output format. Available options depend on your organization's cloud provider and selected mode:

AWS Organizations:

  • CSV mode: No options supported (AWS Athena limitation)
  • Parquet mode: 'compression' - Compression algorithm (default: 'SNAPPY', options: 'SNAPPY', 'GZIP', 'NONE')

GCP Organizations:

  • CSV mode: 'delimiter' (default: ','), 'header' (default: true), 'compression' (optional: 'GZIP')
  • Parquet mode: 'compression' - Compression algorithm (default: 'SNAPPY', options: 'SNAPPY', 'GZIP', 'NONE')

Example: {'compression': 'SNAPPY'} or {'delimiter': ';', 'header': true, 'compression': 'GZIP'}

Response

200 - application/json

Serializer for SQL query execution response.

state
enum<string>
required

Query execution state

  • SUCCEEDED - SUCCEEDED
  • FAILED - FAILED
  • CANCELLED - CANCELLED
  • RUNNING - RUNNING
Available options:
SUCCEEDED,
FAILED,
CANCELLED,
RUNNING
presigned_urls
string<uri>[]

List of presigned URLs to download result files (1 hour expiration)

data_scanned_in_bytes
integer

Amount of data scanned by the query (if succeeded)

execution_time_in_millis
integer

Query execution time in milliseconds (if succeeded)

state_change_reason
string

Error message (if failed)