> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quivr.thevibecompany.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create subscription version

> Edit a Subscription by committing a new immutable Version that becomes current. It pins the current Version of the Subscription's own Saved Query (422 unknown_saved_query otherwise), an evaluator and a destination. It takes effect from its commit, recorded as its activation position with subscription.updated in every Corpus of the previous and new scope. Each later change is judged by the new Version, each earlier one by the Version effective before it. Nothing is backfilled and Matches keep the Version that produced them. Enabled state is unchanged. The evaluator, expression and configuration are checked as on creation (422 unsupported_evaluator, invalid_expression or invalid_subscription_configuration). Replay of the same key and request returns the same Version; a changed request is 409 idempotency_conflict. A deleted Subscription is 409 subscription_deleted.



## OpenAPI

````yaml /openapi.yaml post /v0/subscriptions/{subscription_id}/versions
openapi: 3.1.0
info:
  title: Quivr V2 public text foundation contract
  version: 0.0.0-draft
  description: >-
    THE-543 and THE-547 evaluation contracts; endpoint implementations are
    separate work. Matching criterion is plugin-owned and deferred. One
    configured webhook destination, immutable Matches, independent at-least-once
    Delivery and reference-only notifications. OpenAPI is authoritative for
    transport shapes. THE-640 adds text search and asynchronous Corpus
    projection rebuild initiation.
servers: []
security:
  - ApiKey: []
paths:
  /v0/subscriptions/{subscription_id}/versions:
    post:
      tags:
        - Subscriptions
      summary: Create subscription version
      description: >-
        Edit a Subscription by committing a new immutable Version that becomes
        current. It pins the current Version of the Subscription's own Saved
        Query (422 unknown_saved_query otherwise), an evaluator and a
        destination. It takes effect from its commit, recorded as its activation
        position with subscription.updated in every Corpus of the previous and
        new scope. Each later change is judged by the new Version, each earlier
        one by the Version effective before it. Nothing is backfilled and
        Matches keep the Version that produced them. Enabled state is unchanged.
        The evaluator, expression and configuration are checked as on creation
        (422 unsupported_evaluator, invalid_expression or
        invalid_subscription_configuration). Replay of the same key and request
        returns the same Version; a changed request is 409 idempotency_conflict.
        A deleted Subscription is 409 subscription_deleted.
      operationId: createSubscriptionVersion
      parameters:
        - name: subscription_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionVersionCreate'
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionVersion'
        default:
          description: >-
            Structured error. Existing /v0 authentication, scope, pagination and
            idempotency semantics apply.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SubscriptionVersionCreate:
      type: object
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
          minLength: 1
        saved_query_version_id:
          type: string
          minLength: 1
        evaluator:
          $ref: '#/components/schemas/EvaluatorConfig'
        destination_id:
          type: string
          minLength: 1
      required:
        - idempotency_key
        - saved_query_version_id
        - evaluator
        - destination_id
      description: >-
        New immutable configuration of an existing Subscription. The Saved Query
        and name are unchanged (rename changes the name); saved_query_version_id
        is the current Version of that Saved Query.
    SubscriptionVersion:
      type: object
      additionalProperties: false
      properties:
        subscription_id:
          type: string
          minLength: 1
        version_id:
          type: string
          minLength: 1
        saved_query_id:
          type: string
          minLength: 1
        saved_query_version_id:
          type: string
          minLength: 1
        evaluator:
          $ref: '#/components/schemas/EvaluatorConfig'
        destination_id:
          type: string
          minLength: 1
        owner:
          $ref: '#/components/schemas/SubscriptionOwner'
      required:
        - subscription_id
        - version_id
        - saved_query_id
        - saved_query_version_id
        - evaluator
        - destination_id
      description: >-
        Immutable Subscription configuration. Every Version keeps the
        Subscription's owner, absent for a global Subscription.
    Error:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          minLength: 1
        message:
          type: string
          minLength: 1
        retryable:
          type: boolean
        field:
          type: string
          minLength: 1
          description: >-
            JSON Pointer (RFC 6901) to the request member that caused a 422,
            when known (for example /config/url or /credential/secret/token on
            connector commands).
        resync_url:
          type: string
          format: uri-reference
      required:
        - code
        - message
        - retryable
    EvaluatorConfig:
      type: object
      additionalProperties: false
      properties:
        plugin_id:
          type: string
          minLength: 1
        version:
          type: string
          minLength: 1
        configuration:
          type: object
          additionalProperties: true
      required:
        - plugin_id
        - version
        - configuration
      description: >-
        Pins an installed evaluator by plugin id and version, and its
        configuration. Evaluators are the subscription Contributions of the
        plugins pinned at startup (Plugin Protocol v0); test deployments may
        also install the deterministic fixture quivr.fixture@1. The
        configuration must satisfy the evaluator's declared configuration
        schema.
    SubscriptionOwner:
      type: string
      minLength: 1
      maxLength: 128
      description: >-
        Subscription Owner, an opaque end-user reference defined by the client
        application (for example user-123). Quivr stores, filters and echoes it
        without interpreting it. At most 128 characters without control
        characters; none is reserved for the listing filter (422 invalid_owner).
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        API key, not necessarily a JWT. Server derives Organization, permitted
        actions and Corpus scope; every resource access is authorized.

````