Schedules

Create a schedule

Schedules a saved query to run on a cron cadence and export its result to ONE destination — Google Sheets (spreadsheetId/spreadsheetName + sheetName + startCell) OR Slack (slackChannelId). Scheduling is plan-gated. Available to API keys with both the write and execute scopes, since a schedule runs its saved query's SQL.

post/schedules

Request

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

Request body

savedQueryIdstring required
cronExpressionstring required

5-field cron expression, e.g. '0 7 * * *' for daily 7am

timezonestring

IANA timezone, default UTC

spreadsheetIdstring

Google Sheets destination (existing sheet)

spreadsheetNamestring

Or create a new spreadsheet by name (with createNew: true)

sheetNamestring
startCellstring

A1 notation, default A1

includeHeadersboolean

Default true

createNewboolean

Create a new spreadsheet named spreadsheetName

slackChannelIdstring nullable

Slack destination (instead of Sheets)

slackChannelNamestring nullable
slackMessageTemplatestring nullable

Response

Created

idstring
savedQueryIdstring
cronExpressionstring

5-field cron expression evaluated in timezone, e.g. '0 9 * * 1' for Monday 9am

timezonestring

IANA timezone, e.g. America/New_York

startCellstring

A1 notation anchor for the export

includeHeadersboolean
enabledboolean
nextRunAtstring date-time nullable
lastRunAtstring date-time nullable
lastErrorstring nullable
destinationType'sheets' | 'slack' nullable
spreadsheetIdstring nullable
spreadsheetNamestring nullable
sheetNamestring nullable
slackChannelIdstring nullable
slackChannelNamestring nullable

Changes

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