Skip to main content
POST
/
query
Execute SQL query
curl --request POST \
  --url http://localhost:3000/query \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "sql": "<string>",
  "parameters": [
    "<any>"
  ],
  "timeout": 30000
}
'
{
  "success": true,
  "data": {
    "queryId": "<string>",
    "rows": [
      {}
    ],
    "rowCount": 123,
    "executionTime": 123,
    "queryType": "<string>"
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Format: zdb_your_api_key_here

Body

application/json
sql
string
required

SQL query to execute

Required string length: 1 - 50000
parameters
any[]

Query parameters

timeout
integer
default:30000

Query timeout in milliseconds

Required range: 1000 <= x <= 300000

Response

Query executed successfully

success
boolean
data
object