Skip to main content
POST
/
v1
/
execute
/
{database}
Execute SQL statement with database path
curl --request POST \
  --url https://{sql-node}/v1/execute/{database} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "statement": "<string>",
  "database": "<string>",
  "format": "array",
  "params": {},
  "fetch_size": 0,
  "max_rows": 123,
  "schema": "<string>"
}
'
{
  "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.

Path Parameters

database
string
required

The specific database in your system for the API call.

Query Parameters

format
enum<string>

Sets the format for the requested data (only applies when using Content-Type text/plain).

Available options:
array,
collection
schema
string

The schema to use for the SQL statement.

Body

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

200 - application/json

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)