This feature is only available in the Enterprise version
Data lake
List query runs
Return recent executions of lake SQL for an instance.
GET/data/lake/query-runs
A query run is one execution of lake SQL. Cloud creates a run when you create a new query with sql or saved_query_id, or when a scheduled saved query fires.
Each run stores a snapshot of the SQL and date range that actually ran, the status of that execution, and a preview of the result rows. The preview is bounded: at most 1000 rows, or less if the preview exceeds 2 MB. It is not the full result set. Editing a saved query later does not change past runs.
This endpoint returns recent runs for one instance, newest first. Use the query parameters to narrow by saved query, status, or how the run started.
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.
query_idstringquery
Return only runs that came from this saved query (lake_query_...). Omit it to include every run on the instance, including ad-hoc SQL that was not saved.
statusstringquery
Return only runs in this state: running (still executing), succeeded (finished with rows or an empty result), or failed (the SQL did not complete).
triggerstringquery
Return only runs started this way: manual (you called Create new query) or scheduled (a saved-query schedule fired).
cursorstringquery
ID of the last run from the previous response (next_cursor). Cloud returns the next page after that run. Omit it on the first request.
limitintegerquery
Maximum number of runs to return. Defaults to 50. Maximum 100. Values outside that range are treated as 50.
Response
dataarray
Query runs for this instance, newest first.
Run properties
idstring
Unique id of this run (lake_query_run_...). Pass it to Get query run.
instance_idstring
Unique id of the instance (instance_...).
saved_query_idstring
Saved query this run came from (lake_query_...). Omitted when you ran ad-hoc SQL without a saved query.
triggerstring
How the run started: manual (Create new query) or scheduled (a saved-query schedule).
query_namestring
Display name of the saved query at the time of the run. Empty for ad-hoc SQL.
sqlstring
Exact SQL Cloud executed. This is a snapshot. Later edits to a saved query do not change it.
start_datetimestamp
First day of lake history this run opened. For a rolling saved query, this is the start Cloud resolved at run time.
end_datetimestamp
Last day of lake history this run opened. For a rolling saved query, this is the end Cloud resolved at run time.
statusstring
running while Cloud is still executing, succeeded when it finished, or failed when the SQL did not complete.
row_countinteger
Number of rows the query produced. Can be larger than rows when the preview is truncated.
preview_limitedboolean
true when rows is a truncated preview (more than 1000 rows, or the preview exceeded the size cap). Use row_count for the full total.
duration_msinteger
How long the query took to execute, in milliseconds.
error_codestring
Machine-readable failure code, such as INVALID_SQL or QUERY_TOO_EXPENSIVE. Present only when status is failed.
error_messagestring
Human-readable reason the run failed. Present only when status is failed.
started_attimestamp
When Cloud started executing this run.
finished_attimestamp
When the run reached succeeded or failed. Omitted while status is running.
rowsarray
Preview of result rows. Column names match the SQL aliases. At most 1000 rows. Not the full result when preview_limited is true.
next_cursorstring
ID of the last run on this page. Pass it as cursor on the next request to continue. Empty when there are no more runs.