Skip to main content
POST
/
api
/
analytics
/
sql
Execute SQL against a Superset database
curl --request POST \
  --url https://api.example.com/api/analytics/sql \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sql": "<string>",
  "database_id": 1,
  "schema": "<string>",
  "catalog": "<string>",
  "query_limit": 1000
}
'
{
  "query_id": "<string>",
  "status": "<string>",
  "data": [],
  "columns": []
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
sql
string
required
database_id
integer
default:1
schema
string | null
catalog
string | null
query_limit
integer
default:1000
Required range: 1 <= x <= 10000

Response

Successful Response

query_id
string | null
status
string | null
data
Data · object[]
columns
Columns · object[]