Skip to content
You're viewing documentation for v2026.11.9-beta. It may be out of date.Go to latest
TimescaleDB Enterprise
Esc
↑↓navigate↵open⌘Jpreview

Run a read-only SQL query

Run a SQL query in a read-only session, streaming NDJSON status.

POST/api/v1/database-services/{id}/sql/ro/api/executeQuery
Authorization
tse_sessionAPI key · cookierequired
Path parameters
idstringrequired
Request body
requiredapplication/json
projectIdstring
querystring
runIdstringrequired
serviceIdstring
statementsstring[]
timeoutstring

The timeout of the run as a duration, for example 30s or 5m. The default is 30s. The maximum is 2m in read-only mode and 15m in write mode; a longer value gets the maximum.

Responses
200

OK

default

Error

codestring

Stable code of the refusal, when the route has codes

detailsstring[]

Additional detail, e.g. per-field validation failures

errorstringrequired

Human-readable error message

Request
curl -X POST 'https://console.example.com/api/v1/database-services/string/sql/ro/api/executeQuery' \
  -H 'Cookie: tse_session=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "projectId": "string",
  "query": "string",
  "runId": "string",
  "serviceId": "string",
  "statements": [
    "string"
  ],
  "timeout": "string"
}'
Response
OK