This feature is only available in the Enterprise version

Data lake

Schedule saved query

Create or update a cron schedule for a saved lake query.

PUT/data/lake/queries/{query_id}/schedule

Create or replace the schedule on a saved lake query. When the cron fires, Cloud creates a query run: one execution of the last saved SQL and date range. That run stores a result preview. The schedule does not send email or webhook notifications.

Only the query owner or an admin can set a schedule. cron_expression is a five-field cron (minute hour day-of-month month day-of-week). timezone is an IANA timezone such as America/New_York.

Enterprise authentication

Send these requests to https://api.cloud.blnkfinance.com on Blnk Cloud. On a self-hosted Enterprise deployment, send them to ENTERPRISE_PUBLIC_URL.

Pass an Enterprise API key, or an OAuth access token, in the X-blnk-key header. Create the key in Enterprise API keys, or issue a token with Enterprise OAuth.

This credential comes from the Cloud or Enterprise workspace. A Core API key belongs to the Core instance.

X-blnk-keystringrequiredheader

Enterprise API key, or an OAuth access token.

Path

query_idstringrequiredpath

Unique id of the saved query (lake_query_...). Get it from Get saved query.

Body

cron_expressionstringrequiredbody

Five-field cron that says when Cloud starts a query run (minute hour day-of-month month day-of-week). Example: 0 9 * * * is every day at 09:00 in timezone.

timezonestringrequiredbody

IANA timezone Cloud uses to interpret cron_expression, such as America/New_York or UTC. next_run_at is still returned in UTC. For a rolling saved query, Cloud also resolves the date window in this timezone.

enabledbooleanbody

Whether Cloud will fire the schedule. Defaults to true. Send false to keep the schedule stored but skip runs until you enable it again.

Response

idstring

Unique id of this schedule (lake_query_schedule_...).

query_idstring

Saved query this schedule belongs to (lake_query_...).

cron_expressionstring

Five-field cron Cloud stored. This is when each query run starts, interpreted in timezone.

timezonestring

IANA timezone Cloud uses to interpret the cron, such as America/New_York.

enabledboolean

Whether Cloud will fire the schedule. false keeps the schedule stored but skips runs.

next_run_attimestamp

Next time Cloud will start a query run for this schedule, in UTC.

last_run_attimestamp

When Cloud last started a query run from this schedule. Omitted until the first fire.

created_attimestamp

When the schedule was first created. A replace keeps this value.

updated_attimestamp

When the cron, timezone, or enabled flag was last changed.