> ## 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.

# Rollback pipeline plan

> Make an earlier plan's roles active again, as a new immutable Pipeline Plan with source rollback that api and worker follow without restarting. The default target is the plan the active one replaced; plan_id names another one. Registrations the rollback brings back serve again, even when they were draining or inactive. Registrations it takes out drain, or stop with pinned_work=stop. The target must keep the rules of an activation. Otherwise the answer is 409 plugin_conflict, or 422 unsupported_role when the rollback would change an alert-rule plugin. Every plugin it brings back must answer discovery at its endpoint with its manifest's digest. Otherwise the answer is 409 plugin_unreachable, naming the plugin and the cause, and no plan changes. 409 no_previous_plan when there is no earlier plan to return to. A rollback to the active plan's roles returns the active plan. The same idempotency key with the same request returns the plan it recorded. The same key with another request is 409 idempotency_conflict. Nothing already produced is rewritten. Requires plugins:admin.



## OpenAPI

````yaml /openapi.yaml post /v0/admin/plugins/plan/rollback
openapi: 3.1.0
info:
  title: Quivr HTTP API
  version: 0.0.0-draft
  description: >-
    Every endpoint of the Quivr v0 HTTP API. Send an API key as a bearer token;
    the key decides the Organization, the actions and the Corpora a request may
    reach.
servers: []
security:
  - ApiKey: []
paths:
  /v0/admin/plugins/plan/rollback:
    post:
      tags:
        - Admin
      summary: Rollback pipeline plan
      description: >-
        Make an earlier plan's roles active again, as a new immutable Pipeline
        Plan with source rollback that api and worker follow without restarting.
        The default target is the plan the active one replaced; plan_id names
        another one. Registrations the rollback brings back serve again, even
        when they were draining or inactive. Registrations it takes out drain,
        or stop with pinned_work=stop. The target must keep the rules of an
        activation. Otherwise the answer is 409 plugin_conflict, or 422
        unsupported_role when the rollback would change an alert-rule plugin.
        Every plugin it brings back must answer discovery at its endpoint with
        its manifest's digest. Otherwise the answer is 409 plugin_unreachable,
        naming the plugin and the cause, and no plan changes. 409
        no_previous_plan when there is no earlier plan to return to. A rollback
        to the active plan's roles returns the active plan. The same idempotency
        key with the same request returns the plan it recorded. The same key
        with another request is 409 idempotency_conflict. Nothing already
        produced is rewritten. Requires plugins:admin.
      operationId: rollbackPipelinePlan
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PipelinePlanRollbackRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelinePlan'
        default:
          description: >-
            Structured error; 400 malformed, 401 unauthenticated, 403 without
            plugins:admin, 404 unknown plan, 409 idempotency_conflict,
            no_previous_plan, plugin_conflict, plugin_unreachable or
            registration_not_validated, 422 invalid_schema or unsupported_role,
            503 storage unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PipelinePlanRollbackRequest:
      type: object
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 200
        plan_id:
          type: string
          minLength: 1
          description: >-
            The plan whose roles become active again; absent returns to the plan
            the active one replaced (its previous_plan_id).
        pinned_work:
          type: string
          enum:
            - drain
            - stop
          default: drain
          description: >-
            What happens to work pinned to a plan naming a plugin version the
            rollback takes out. drain lets it finish on that version, which
            stays draining meanwhile. stop keeps it from calling that version
            again once each process follows the new plan (within
            plugin_plan_poll). Its next call fails instead. The processing of a
            Version then stops with the diagnostic pinned_plan_stopped, with the
            outcome of pinned_plugin_unavailable, and a rebuild fails with that
            code. A connector run fails as when its plugin is unavailable, and
            its next run uses the active plan.
      required:
        - idempotency_key
    PipelinePlan:
      type: object
      additionalProperties: false
      properties:
        plan_id:
          type: string
          minLength: 1
        created_at:
          type: string
          format: date-time
        activated_at:
          type: string
          format: date-time
        source:
          type: string
          enum:
            - configuration
            - activation
            - rollback
          description: >-
            What recorded the plan, and so why the plan changed. configuration
            is the startup configuration, which applies the roles its pins
            changed since it last applied, even over an earlier activation of
            the same role. activation is an operator activation. rollback is an
            operator rollback to an earlier plan's roles.
        previous_plan_id:
          type: string
          minLength: 1
          description: >-
            The plan this one replaced; absent for the first plan of the
            deployment.
        roles:
          type: array
          description: One entry per role, sorted by role.
          items:
            $ref: '#/components/schemas/PipelinePlanRole'
      required:
        - plan_id
        - created_at
        - activated_at
        - source
        - roles
    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
    PipelinePlanRole:
      type: object
      additionalProperties: false
      properties:
        role:
          type: string
          minLength: 1
        registration_id:
          type: string
          minLength: 1
        plugin_id:
          type: string
          minLength: 1
        version:
          type: string
          minLength: 1
      required:
        - role
        - registration_id
        - plugin_id
        - version
  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.

````