---
title: "Create saved query version"
method: POST
path: "/v0/saved-queries/{saved_query_id}/versions"
tags: ["Saved queries"]
---

# Create saved query version

`POST /v0/saved-queries/{saved_query_id}/versions`

## 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/{saved_query_id}/versions`
- Auth: HTTP bearer

Edit a Saved Query by committing a new immutable Version that becomes its current Version, with saved_query.updated in every Corpus of the previous and new scope. Subscriptions keep the Version they pin; a new Subscription Version moves one. The key must grant every Corpus of the current and new definitions. Replay of the same key and request returns the same Version; a changed request is 409 idempotency_conflict. A deleted Saved Query is 409 saved_query_deleted.

## Path parameters

- `saved_query_id` string, required

## Request body

- SavedQueryVersionCreate: New immutable definition of an existing Saved Query. The name is unchanged (rename changes it).
  - `idempotency_key` 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

- SavedQueryVersion
  - `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)
