SQL
query.update
Update a saved query
Details
- Endpoint
- PUT /v1/query/:query_id
- Credits
- Free
- Rate class
- Light. Counts against your light requests per second.
- Also called
- /api/v1/query/:query_id, /v1/query/:query_id/update, /api/v1/query/:query_id/update
Changes any of name, description, query_sql, dialect, query_parameters, visualizations, tags, is_private or is_archived. Owner only. PUT, or POST to /v1/query/{query_id}/update.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| description | string | |
| query_sql | string | The SQL (also accepted as sql). |
| dialect | string | One of "tide", "trino". |
| query_parameters | array of any | [{ key, type: text | number | date | list, value, options? }] |
| visualizations | array of any | [{ id, type, name, config }] |
| tags | array of any | |
| is_private | boolean | |
| query_idrequired | integer | |
| is_archived | boolean |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl
curl -X PUT "https://api.tide.ad/v1/query/1" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"name": "Renamed"
}'TypeScript
const res = await fetch("https://api.tide.ad/v1/query/1", {
method: "PUT",
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({
"name": "Renamed"
}),
});
const data = await res.json();Response
No example response is available for this method yet.