This feature is only available in the Enterprise version

Data lake

Get query run

Return one lake query run, including the SQL snapshot and a result preview.

GET/data/lake/query-runs/{run_id}

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.

This endpoint returns one run by run_id. You get the SQL and date range that actually ran, the status of that execution, and a preview of the result rows (at most 1000 rows, or less if the preview exceeds 2 MB). The SQL and dates are a snapshot from the time of the run.

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

run_idstringrequiredpath

Unique id of the query run (lake_query_run_...). Get it from Create new query (run_id) or List query runs.

Response

idstring

Unique id of this run (lake_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 2 MB). 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.

rowsarray

Preview of result rows. Column names match the SQL aliases. At most 1000 rows. Not the full result when preview_limited is true.

started_attimestamp

When Cloud started executing this run.

finished_attimestamp

When the run reached succeeded or failed. Omitted while status is running.

created_attimestamp

When Cloud first recorded this run (usually the same moment as started_at).

updated_attimestamp

When Cloud last wrote to this run, such as when it moved from running to succeeded or failed.