API: Saved Queries
The workspace SQL library. All endpoints require authentication unless noted. 8 endpoints.
GET /api/saved-queries
Section titled “GET /api/saved-queries”List saved queries (paginated)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer | no | |
offset |
integer | no | |
search |
string | no | |
sourceId |
string | no | |
modelId |
string | no | |
tag |
string | no | |
dashboardId |
string | no | |
unused |
boolean | no | |
favorite |
boolean | no | |
sort |
"recent" | "name" | "created" |
no |
Responses: 200
POST /api/saved-queries
Section titled “POST /api/saved-queries”Save a query
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | |
description |
string | no | |
sql |
string | yes | |
sourceId |
string | no | |
modelId |
string | no |
Responses: 200
GET /api/saved-queries/{id}
Section titled “GET /api/saved-queries/{id}”Get a saved query
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Responses: 200
PUT /api/saved-queries/{id}
Section titled “PUT /api/saved-queries/{id}”Update a saved query
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | no | |
description |
string,null | no | |
sql |
string | no | |
sourceId |
string,null | no | |
modelId |
string,null | no |
Responses: 200
DELETE /api/saved-queries/{id}
Section titled “DELETE /api/saved-queries/{id}”Delete a saved query
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Responses: 200
POST /api/saved-queries/{id}/favorite
Section titled “POST /api/saved-queries/{id}/favorite”Favorite a saved query
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Responses: 200
DELETE /api/saved-queries/{id}/favorite
Section titled “DELETE /api/saved-queries/{id}/favorite”Unfavorite a saved query
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Responses: 200
PUT /api/saved-queries/{id}/tags
Section titled “PUT /api/saved-queries/{id}/tags”Set the tags on a saved query
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
tagIds |
array of string | yes |
Responses: 200