Data lake
Get saved query
Return one saved lake query, including its SQL, date range, and schedule when one is set.
/data/lake/queries/{query_id}A saved query is lake SQL you store on an instance so you can rerun it later. It is not a query run.
This endpoint returns one saved query by query_id, including the 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-keystring
Enterprise API key, or an OAuth access token.
Path
query_idstring
Unique id of the saved query (lake_query_...). Get it from List saved queries or Create saved query.
Response
idstring
Unique id of this saved query (lake_query_...). Pass it as saved_query_id on Create new query.
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.
descriptionstring
Optional note about what the query returns. Empty string when none was set.
sqlstring
Read-only DuckDB SELECT or WITH Cloud runs each time you execute this 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. 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.
created_attimestamp
When the saved query was first created.
updated_attimestamp
When the saved SQL, name, description, or date range was last changed.