Data lake
Create new query
Learn what the instance data lake is and run read-only SQL against it through Blnk Cloud.
POST
The data lake is a stored copy of your ledger, built for reports. Your ledger stays the system of record. A lake builder then copies ledgers, balances, transactions, and identities into daily history for reporting and audits.
This endpoint runs read-only SQL against that copy. It is not a live instance query. Use it for reporting and audits over a date range. The
start_date and end_date you send choose which days of history Cloud opens. A WHERE filter can drop rows inside those days. It does not choose which days to scan.
When you send sql or saved_query_id, Cloud also records a query run: one execution, with a snapshot of the SQL and dates plus a result preview. Filter-mode requests return rows in this response and do not create a run.
For live lists, filters, and current holdings, use the Filters API. To learn more about the data lake, see Insights.
POST /data/lake/query accepts data:read or data:write. This feature is available only to Production managed instances and Enterprise customers.Authorization
Blnk Cloud APIs support any one of the following authentication methods. All of them work with yourCLOUD_API_KEY or OAUTH_ACCESS_TOKEN.
- Bearer token
- X-Blnk-Key header
- X-API-Key header
Request body
You can create a new query in two ways: using SQL or using filters.- Using SQL
- Using filters
Send a read-only
SELECT or WITH statement. Narrow rows in the SQL with WHERE. To rerun a saved query, send saved_query_id instead of sql.string
required
Unique id of the instance (
instance_...). Get it from get instance details. Do not pass deployment_id. Optional when you send saved_query_id; Cloud uses the saved query’s instance.Pass it in the request JSON, not as a query parameter.string
First day of lake history Cloud opens for this query. ISO date (
2026-08-01) or datetime. Required with end_date when you send sql. A WHERE clause can drop rows inside these days. It does not choose which days to scan.string
Last day of lake history Cloud opens for this query. Required with
start_date when you send sql. Must be after start_date.string
One read-only DuckDB
SELECT or WITH statement. Cloud infers tables from the SQL. Allowed tables are transactions, balances, ledgers, identity, and anomalies. Do not send sql together with saved_query_id or resource.string
ID of a saved query to run (
lake_query_...) instead of sending sql. Cloud loads the saved SQL and resolves the date range from the query’s range_mode (fixed dates or the current rolling window).Response
string
ID of the query run Cloud recorded for this SQL request (
lake_query_run_...). Use it to fetch the snapshot and preview later. Present when you send sql or saved_query_id.array
Result rows for this request. Column names match the SQL aliases, or the columns of
resource when you used filters. For SQL, this is the same bounded preview stored on the query run (at most 1000 rows).integer
Number of rows the query produced. Can be larger than
rows when the SQL preview is truncated.integer
How long the query took to execute, in milliseconds.