---
title: "Create saved query"
method: POST
path: "/v0/saved-queries"
tags: ["Saved queries"]
---

# Create saved query

`POST /v0/saved-queries`

## Request

- Base URL: `https://docs.quivr.thevibecompany.co` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.quivr.thevibecompany.co/v0/saved-queries`
- Auth: HTTP bearer

Persist definition and first immutable version. Replay same key/request returns same IDs; conflict on changed request. Query creation alone evaluates nothing.

## Request body

- SavedQueryCreate
  - `idempotency_key` string, required
  - `name` string, required
  - `definition` SavedQueryDefinition, required: Immutable query definition. Expression semantics belong to the evaluator plugin; no core keyword or semantic threshold is implied. All Corpora belong to the authorized Organization.
    - `corpus_ids` string[], required
    - `expression` object, required
    - `retrieval_profile` string, required: A search profile the deployment answers (listSearchProfiles), recorded as sent; an unserved profile is 422 unsupported_profile. The profile is checked only when a definition is written, so a Version keeps its profile and keeps evaluating after the profile stops being served.
    - `temporal_policy` 'from_activation', required

## Response `201`

Successful response

- SavedQuery
  - `saved_query_id` string, required
  - `name` string, required
  - `deleted` boolean, required: Logically deleted; the Saved Query and its Versions stay readable.
  - `current_version` SavedQueryVersion, required
    - `saved_query_id` string, required
    - `version_id` string, required
    - `definition` SavedQueryDefinition, required: Immutable query definition. Expression semantics belong to the evaluator plugin; no core keyword or semantic threshold is implied. All Corpora belong to the authorized Organization.
      - `corpus_ids` string[], required
      - `expression` object, required
      - `retrieval_profile` string, required: A search profile the deployment answers (listSearchProfiles), recorded as sent; an unserved profile is 422 unsupported_profile. The profile is checked only when a definition is written, so a Version keeps its profile and keeps evaluating after the profile stops being served.
      - `temporal_policy` 'from_activation', required

## Other responses

- `default`: Structured error. Existing /v0 authentication, scope, pagination and idempotency semantics apply.

---

[API](https://skmtc.dev/thevibecompany/apis/quivr-http-api.md) - [All operations](https://skmtc.dev/thevibecompany/apis/quivr-http-api/llms.txt) - [OpenAPI document](https://skmtc.dev/thevibecompany/apis/quivr-http-api/revisions/4f4e30ba8f4e?raw)
