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

# Cancel operation

> Idempotent cancellation request; does not undo committed effects. Terminal operation returns its existing state. A racing completion may win. Cancellation becomes terminal only after work stops safely; no partial active projection cutover.



## OpenAPI

````yaml /openapi.yaml post /v0/operations/{operation_id}/cancel
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/operations/{operation_id}/cancel:
    post:
      tags:
        - Operations
      summary: Cancel operation
      description: >-
        Idempotent cancellation request; does not undo committed effects.
        Terminal operation returns its existing state. A racing completion may
        win. Cancellation becomes terminal only after work stops safely; no
        partial active projection cutover.
      operationId: cancelOperation
      parameters:
        - name: operation_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActionRequest'
      responses:
        '202':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
        default:
          description: Structured error; see contract HTTP mapping.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ActionRequest:
      type: object
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
          minLength: 1
      required:
        - idempotency_key
    Operation:
      type: object
      additionalProperties: false
      properties:
        operation_id:
          type: string
          minLength: 1
        kind:
          type: string
          minLength: 1
        state:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancel_requested
            - canceled
        progress:
          type: number
          minimum: 0
          maximum: 1
          description: Approximate fraction, omitted when unknown.
        counters:
          type: object
          additionalProperties:
            type: integer
            minimum: 0
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          maxItems: 20
        previous_operation_id:
          type: string
          minLength: 1
        corpus_id:
          type: string
          minLength: 1
        result:
          $ref: '#/components/schemas/ProjectionRebuildResult'
      required:
        - operation_id
        - kind
        - state
        - counters
        - errors
      description: >-
        Administrative execution only. Retries keep identity. Intentional
        terminal rerun has a new ID and previous_operation_id. Cancellation does
        not promise universal rollback; already-terminal state and racing
        completion may win. projection_rebuild and retrieval_configuration
        Operations require corpus_id; when succeeded they require result naming
        the activated logical generation. This result shape covers those two
        command kinds only.
      if:
        properties:
          kind:
            enum:
              - projection_rebuild
              - retrieval_configuration
        required:
          - kind
      then:
        required:
          - corpus_id
        if:
          properties:
            state:
              const: succeeded
          required:
            - state
        then:
          required:
            - result
    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
    ProjectionRebuildResult:
      type: object
      additionalProperties: false
      properties:
        projection_generation_id:
          type: string
          minLength: 1
      required:
        - projection_generation_id
      description: >-
        Logical generation activated for the requested Corpus. Opaque ID, never
        a physical search collection name.
  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.

````