Skip to content

Execute SQL statement

POST
/api/v1/statements/execute
curl --request POST \
--url https://example.com/api/v1/statements/execute \
--header 'Content-Type: application/json' \
--data '{ "statement": "example", "warehouse_id": "example", "catalog": "example", "schema": "example", "wait": true, "poll_interval": 1.5, "max_wait_seconds": 600 }'

Execute a SQL statement.

X-Environment-Id
Any of:
string
Media typeapplication/json
StatementExecuteRequest

Legacy request model for backwards compatibility.

object
statement
required
Statement

SQL statement to execute

string
warehouse_id
required
Warehouse Id

SQL warehouse ID to use for execution

string
catalog
Any of:
string
schema
Any of:
string
wait
Wait

Wait for statement completion

boolean
default: true
poll_interval
Poll Interval

Polling interval in seconds

number
default: 1.5
max_wait_seconds
Max Wait Seconds

Maximum wait time in seconds

integer
default: 600

Successful Response

Media typeapplication/json
StatementExecuteResponse

Legacy response model for backwards compatibility.

object
status
required
Status

Execution status (SUBMITTED, SUCCEEDED, FAILED, CANCELED)

string
statement_id
required
Statement Id

Unique identifier for the statement

string
columns
Any of:
Array<string>
rows
Any of:
Array<Array>
error
Any of:
string
execution_time_seconds
Any of:
number
Examplegenerated
{
"status": "example",
"statement_id": "example",
"columns": [
"example"
],
"rows": [
[
"example"
]
],
"error": "example",
"execution_time_seconds": 1
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}