Update saved queries
PATCH /api/v1/saved-queries/{savedQueryId}: request fields and declared response contract.
PATCH/api/v1/saved-queries/{savedQueryId}
| Permission | saved-query.manage |
|---|---|
| Workspace scope | required |
| Scope target | workspace |
Parameters
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| savedQueryId | string | required | non-null | — |
Query parameters: none.
Request body
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| expectedRevision | integer | required | non-null | — |
| definition | object | required | non-null | — |
| definition.title | string | required | non-null | — |
| definition.description | string | optional | non-null | — |
| definition.kind | string | required | non-null | — |
| definition.target | unknown | required | non-null | — |
| definition.where | reference | optional | non-null | — |
| definition.composite | reference | optional | non-null | — |
| definition.sort | array | optional | non-null | — |
| definition.defaultLimit | integer | optional | non-null | — |
| definition.tags | array | optional | non-null | — |
| acknowledgeBreakingChange | boolean | optional | non-null | — |
Response
200
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| data | object | required | non-null | — |
| data.savedQueryId | string | required | non-null | — |
| data.revision | integer | required | non-null | — |
| data.definitionVersion | unknown | required | non-null | — |
| data.dependents | array | required | non-null | — |
Declared failures
| SAVED_QUERY_BREAKING_CHANGE | 409 — not retryable |
|---|---|
| SAVED_QUERY_OWNERSHIP_FORBIDDEN | 403 — not retryable |
| SAVED_QUERY_QUOTA_EXCEEDED | 422 — not retryable |
| SAVED_QUERY_REVISION_CONFLICT | 409 — retryable |
| SAVED_QUERY_UPDATE_FAILED | 400 — not retryable |
Readback
Read the result back with:
- savedQueries.get
Request example
Schematic only. Replace placeholders with real values and include all required nested fields.
PATCH /api/v1/saved-queries/{savedQueryId} HTTP/1.1
Authorization: Bearer <token>
x-merulan-workspace-id: <workspace-id>
Content-Type: application/json
{
"expectedRevision": 0,
"definition": {}
}