Skip to main content
PATCH
Update a saved lake query. Send only the fields you want to change. Changing the SQL or date range does not rewrite past query runs. Those runs keep the snapshot from when they executed. Only the query owner or an admin can update it. If you change range_mode to fixed, send start_date and end_date. If you change it to rolling, send rolling_days.

Authorization

Blnk Cloud APIs support any one of the following authentication methods. All of them work with your CLOUD_API_KEY or OAUTH_ACCESS_TOKEN.
Pass Authorization: Bearer CLOUD_API_KEY or Authorization: Bearer OAUTH_ACCESS_TOKEN.
string
required
Cloud API key or OAuth access token. Create credentials in API keys or OAuth.

Path

string
required
Unique id of the saved query (lake_query_...). Get it from List saved queries or Get saved query.

Body

string
Unique id of the instance (instance_...). Get it from get instance details. Do not pass deployment_id. Send this to move the query to a different instance in the same workspace.
string
Replacement label shown in Insights and copied onto later query runs. Maximum 160 characters.
string
Replacement note about what the query returns. Maximum 1000 characters.
string
Replacement read-only DuckDB SELECT or WITH. Same table and statement rules as Create new query. Later runs use this SQL. Past runs keep the old snapshot.
string
How Cloud should pick the lake date range on later runs. fixed uses start_date and end_date. rolling uses the last rolling_days days, resolved at run time.
string
First day of lake history. Required when you set range_mode to fixed. ISO date or datetime.
string
Last day of lake history. Required when you set range_mode to fixed. Must be after start_date.
integer
Number of days of lake history Cloud opens on later runs (1 to 3650). Required when you set range_mode to rolling. Cloud resolves the window at run time.

Response

string
Unique id of this saved query (lake_query_...).
string
Unique id of the instance (instance_...) this query is bound to after the update.
string
User who created the query. The owner does not change when you update other fields.
string
Current label after the update.
string
Current note after the update.
string
Current SELECT or WITH after the update. Later runs use this SQL.
string
How Cloud picks the lake date range on later runs: fixed or rolling.
timestamp
First day of lake history for a fixed query. Omitted when range_mode is rolling.
timestamp
Last day of lake history for a fixed query. Omitted when range_mode is rolling.
integer
Number of days of lake history to open when range_mode is rolling. 0 when the query is fixed.
timestamp
When the saved query was first created. This does not change on update.
timestamp
When this update was applied.

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.