Queries

Run a saved query

Runs a saved query, substituting its declared {{variables}} from the values supplied. The caller sends values, never SQL: the SQL comes from the stored query and every value is type-checked and escaped server side. A value that is missing or invalid returns 422 with one entry per bad variable and executes nothing. An absent name falls back to that variable's default; a name present with an empty string stays empty. Same read-only guard, rate limit and monthly quota as POST /queries/execute. Available to API keys with the execute scope.

post/queries/{id}/run

Request

  • Base URL: https://saturnsql.com/api
  • URL: https://saturnsql.com/api/queries/{id}/run
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Path parameters

idstring cuid required

Query parameters

valuesobject required

Variable values by name. An absent name falls back to that variable's default; a name present with an empty string stays empty.

timeZonestring required

IANA time zone used to resolve relative date defaults (default: UTC)

limitnumber required

Maximum rows to return (default: 1000, max: 10000)

refreshboolean required

Skip the result cache and read the database now. Omit to allow a cached result.

Request body

valuesobject

Variable values by name

timeZonestring

IANA zone used to resolve relative date defaults (default UTC)

limitinteger

Max rows (default 1000)

Response

Result rows

successboolean

Changes

No recorded changes to this operation across all 1 revision of this API.