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

# Withdraw record

> Durably commit withdrawal and Receipt before responding. Terminal identity fence, including before first materialization; no physical purge and no cascade. Uses a distinct withdrawal route family.



## OpenAPI

````yaml /openapi.yaml post /v0/records/withdrawals
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/records/withdrawals:
    post:
      tags:
        - Records
      summary: Withdraw record
      description: >-
        Durably commit withdrawal and Receipt before responding. Terminal
        identity fence, including before first materialization; no physical
        purge and no cascade. Uses a distinct withdrawal route family.
      operationId: withdrawRecord
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WithdrawalCommand'
      responses:
        '202':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Receipt'
        default:
          description: >-
            Structured error. 400 malformed; 401 unauthenticated; 403 forbidden
            action; 404 absent or inaccessible; 409 conflict; 413 oversized; 422
            invalid input; 429 throttled; 503 temporary failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WithdrawalCommand:
      type: object
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
          minLength: 1
        source:
          $ref: '#/components/schemas/SourceIdentity'
        reason:
          type: string
          minLength: 1
      required:
        - idempotency_key
        - source
    Receipt:
      type: object
      additionalProperties: false
      properties:
        receipt_id:
          type: string
          minLength: 1
        state:
          type: string
          enum:
            - pending
            - resolved
        outcome:
          type: string
          enum:
            - created
            - duplicate
            - withdrawal_applied
            - conflict
        record_id:
          type: string
          minLength: 1
        version_id:
          type: string
          minLength: 1
        availability:
          $ref: '#/components/schemas/Availability'
        diagnostics:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          maxItems: 20
        source:
          $ref: '#/components/schemas/SourceIdentity'
        processing:
          $ref: '#/components/schemas/ProcessingSummary'
      required:
        - receipt_id
        - state
        - diagnostics
        - source
        - processing
      description: >-
        Durable acceptance outcome, not workflow state. Availability is a
        separate authorized live read view; omitted before a linked version
        exists. Infrastructure retry never resolves a Receipt as failed.
      if:
        properties:
          state:
            const: pending
      then:
        not:
          required:
            - outcome
      else:
        required:
          - outcome
    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
    SourceIdentity:
      type: object
      additionalProperties: false
      properties:
        corpus_id:
          type: string
          minLength: 1
        namespace:
          type: string
          minLength: 1
        record_key:
          type: string
          minLength: 1
      required:
        - corpus_id
        - namespace
        - record_key
    Availability:
      type: object
      additionalProperties: false
      properties:
        state:
          type: string
          enum:
            - materialized
            - building_baseline
            - retrieval_ready
            - quarantined
        is_current:
          type: boolean
        searchable:
          type: boolean
      required:
        - state
        - is_current
        - searchable
    ProcessingSummary:
      type: object
      additionalProperties: false
      required:
        - state
      properties:
        state:
          type: string
          enum:
            - queued
            - running
            - retrying
            - blocked
            - idle
        phase:
          type: string
          enum:
            - materialization
            - baseline
            - enrichment
        message:
          type: string
      description: >-
        Live read view, not a Receipt lifecycle or public workflow identifier.
        blocked means an outstanding contribution needs intervention;
        diagnostics describe why. idle means no work currently pending, not a
        promise of final enrichment. Phase is omitted when idle; required and
        optional progress do not override Version Availability.
  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.

````