Preview saved queries
POST /api/v1/saved-queries/preview: request fields and declared response contract.
POST/api/v1/saved-queries/preview
| Permission | saved-query.read |
|---|---|
| Workspace scope | required |
| Scope target | workspace |
Request body
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| 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 | — |
| resultMode | "rows" | "refs" | optional | non-null | — |
| size | integer | optional | non-null | — |
Response
201
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| data | unknown | required | non-null | — |
Declared failures
| SAVED_QUERY_PREVIEW_FAILED | 400 — not retryable |
|---|---|
| SAVED_QUERY_SET_INVALID | 422 — not retryable |
| SAVED_QUERY_SET_OVERFLOW | 422 — not retryable |
| SAVED_QUERY_SET_PROJECTION_STALE | 503 — retryable |
| SAVED_QUERY_SET_UNAUTHORIZED | 403 — not retryable |
Readback
This method returns the current state it read.
- savedQueries.preview
Request example
Schematic only. Replace placeholders with real values and include all required nested fields.
POST /api/v1/saved-queries/preview HTTP/1.1
Authorization: Bearer <token>
x-merulan-workspace-id: <workspace-id>
Content-Type: application/json
{
"definition": {}
}