Create saved queries
POST /api/v1/saved-queries: request fields and declared response contract.
POST/api/v1/saved-queries
| Permission | saved-query.manage |
|---|---|
| Workspace scope | required |
| Scope target | workspace |
Request body
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| key | string | required | non-null | — |
| title | string | required | non-null | — |
| description | string | optional | non-null | — |
| kind | string | required | non-null | — |
| target | unknown | required | non-null | — |
| where | reference | optional | non-null | — |
| composite | reference | optional | non-null | — |
| sort | array | optional | non-null | — |
| defaultLimit | integer | optional | non-null | — |
| tags | array | optional | non-null | — |
Response
201
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| data | object | required | non-null | — |
| data.id | string | required | non-null | — |
Declared failures
| SAVED_QUERY_CREATE_FAILED | 400 — not retryable |
|---|---|
| SAVED_QUERY_QUOTA_EXCEEDED | 422 — 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.
POST /api/v1/saved-queries HTTP/1.1
Authorization: Bearer <token>
x-merulan-workspace-id: <workspace-id>
Content-Type: application/json
{
"key": "<key>",
"title": "<title>",
"kind": "<kind>",
"target": "<target>"
}