Skip to main content
POST
/
v1
/
execute
Execute SQL statement
curl --request POST \
  --url https://{sql-node}/v1/execute \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "statement": "SELECT * FROM sys.dummy2;",
  "database": "system",
  "format": "collection"
}
'
{
  "query_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": {
    "reason": "<string>",
    "sql_state": "<string>",
    "vendor_code": 123
  },
  "data": [
    {}
  ],
  "schema": [
    {
      "name": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Access token obtained from the /v1/login endpoint. Include in the Authorization header as: Bearer {token}

Headers

Content-Type
enum<string>
default:application/json
required

Specifies the request body format. For queries expected to return large result sets, use application/stream+json with Accept header.

Available options:
application/json,
text/plain
Accept
enum<string>
default:application/json

Supported response media types. The API returns large query results using chunked encoding.

Available options:
application/json,
application/stream+json,
application/parquet
Accept-Encoding
string

Supported compression algorithms for responses. You can specify multiple algorithms as a comma-separated list.

Note: For large result sets, compression can impact performance. Without compression, result sets can be processed in a streaming fashion. With compression, the entire result set must be compressed before it is returned to the client.

Preferred-Encoding
enum<string>

Indicates the preferred encoding type from those specified in the Accept-Encoding parameter.

Available options:
gzip,
br
Preferred-Compression-Level
integer

Specifies the compression level for the selected encoding algorithm. Values range from 1 (fastest, least compression) to 9 (slowest, maximum compression).

Required range: 1 <= x <= 9

Body

application/json
statement
string
required

A valid SQL statement to execute

database
string

Target database for the query

format
enum<string>
default:array

Response format:

  • array - Returns schema and data as arrays (more efficient for large data sets)
  • collection - Returns data as JSON objects (more convenient for client processing)
Available options:
array,
collection
params
object

Parameters to substitute in the SQL statement for values enclosed in braces. The keys should match the parameter names in the statement (without the enclosing braces).

fetch_size
integer
default:0

Number of rows to return in each chunk for streaming responses. Use 0 to let the database determine the size.

Required range: x >= 0
max_rows
integer

Maximum number of rows to return

schema
string

The schema to use for the SQL statement

Response

Successful query execution

query_id
string<uuid>

Unique identifier for the query

status
object

Status information for API responses

data

Query results as JSON objects (collection format)

schema
object[]

Column schema (when using array format)