This feature is only available in the Enterprise version
Data lake
List saved queries
Return saved lake queries for an instance, including each query's schedule when one is set.
GET/data/lake/queries
This endpoint returns saved queries for one instance, newest first (updated_at descending). Each item includes the saved SQL, how Cloud picks the date range, and the schedule when one is set.
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.
Query parameters
instance_idstringrequiredquery
Unique id of the instance (instance_...). Get it from get instance details. Do not pass deployment_id.
Response
dataarray
Saved queries on this instance, newest first.
Query properties
idstring
Unique id of this saved query (lake_query_...). Pass it as saved_query_id on Create new query, or as id on get, update, delete, and schedule.
instance_idstring
Unique id of the instance (instance_...) this query is bound to.
owner_user_idstring
User who created the query. Anyone in the workspace can run it. Only this owner or an admin can update, delete, or schedule it.
namestring
Label shown in Insights and copied onto query runs that come from this query. Maximum 160 characters.
descriptionstring
Optional note about what the query returns. Maximum 1000 characters. Empty string when you omit it.
sqlstring
Read-only DuckDB SELECT or WITH Cloud runs each time you execute this query. Same table and statement rules as Create new query.
range_modestring
How Cloud picks the lake date range when the query runs. fixed uses the stored start_date and end_date. rolling uses the last rolling_days days, resolved at run time.
start_datetimestamp
First day of lake history for a fixed query. Omitted when range_mode is rolling.
end_datetimestamp
Last day of lake history for a fixed query. Must be after start_date. Omitted when range_mode is rolling.
rolling_daysinteger
Number of days of lake history to open when range_mode is rolling (1 to 3650). 0 when the query is fixed.
scheduleobject
Cron schedule Cloud uses to run this query automatically. Present only after you set a schedule.
Schedule properties
idstring
Unique id of the schedule (lake_query_schedule_...).
query_idstring
Saved query this schedule belongs to (lake_query_...).
cron_expressionstring
Five-field cron that says when Cloud starts a query run. Example: 0 9 * * * is every day at 09:00 in timezone.
timezonestring
IANA timezone Cloud uses to interpret the cron, such as America/New_York. next_run_at is still returned in UTC.
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 saved query was first created.
updated_attimestamp
When the saved SQL, name, description, or date range was last changed. List order uses this field.