Queries

Save a query

Saves a query for reuse, optionally filed into a folder with folderPath (null = root). Available to API keys with the write scope. Sharing a query company-wide is plan-gated and done in the web app.

The fields below are the whole create surface: description and chart are ignored if sent. The saved query is immediately readable at /app/report/{id}, where the result shape decides the chart.

post/queries

Request

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

Request body

namestring required
sqlstring required
connectionIdstring

Optional; the connection this query targets

folderPathstring nullable

A single flat folder label, not a nested path ("A/B" is one label); null = root

Response

Saved

idstring
namestring
sqlstring
connectionIdstring nullable
folderPathstring nullable

A single flat folder label (not a nested path); "A/B" is one folder named "A/B", not "A" containing "B". null = root.

isSharedboolean
descriptionstring nullable

Subtitle on the report page. Returned by GET /queries; nothing can set it yet, so always null.

userIdstring
createdAtstring date-time
updatedAtstring date-time

Changes

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