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

# Ingest record

> Commit durable input, Receipt and dispatch intent before responding. Same key and canonical request returns same Receipt; changed request conflicts. A new source revision corrects the Record. All accepted/replayed submissions use 202, even when a replayed Receipt has resolved.



## OpenAPI

````yaml /openapi.yaml post /v0/records
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:
    post:
      tags:
        - Records
      summary: Ingest record
      description: >-
        Commit durable input, Receipt and dispatch intent before responding.
        Same key and canonical request returns same Receipt; changed request
        conflicts. A new source revision corrects the Record. All
        accepted/replayed submissions use 202, even when a replayed Receipt has
        resolved.
      operationId: ingestRecord
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestCommand'
      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:
    IngestCommand:
      type: object
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
          minLength: 1
        source:
          $ref: '#/components/schemas/SourceIdentity'
        source_revision:
          type: string
          minLength: 1
        source_position:
          type: string
          pattern: ^[0-9]+$
          description: >-
            Optional monotonic source position, encoded as decimal text to avoid
            JSON numeric precision loss.
        content:
          oneOf:
            - $ref: '#/components/schemas/TextContent'
            - $ref: '#/components/schemas/BlobContent'
            - $ref: '#/components/schemas/ManifestContent'
          discriminator:
            propertyName: kind
            mapping:
              text:
                $ref: '#/components/schemas/TextContent'
              blob:
                $ref: '#/components/schemas/BlobContent'
              manifest:
                $ref: '#/components/schemas/ManifestContent'
        extensions:
          $ref: '#/components/schemas/Extensions'
        provenance:
          $ref: '#/components/schemas/Provenance'
      required:
        - idempotency_key
        - source
        - content
      description: >-
        Initial request shape. Same source identity creates or corrects a
        Record. Same external revision with different canonical content
        conflicts. No revision means canonical Manifest digest identity; no
        source position means durable acceptance order. Single and batch entry
        replay share route_family=ingestion. A blob content accepts a verified
        text/* Blob, read at acceptance, or a Blob whose media type the
        installation routes to an external normalizer; that normalizer runs
        after acceptance and its output is the published Manifest, while the
        Version identity still derives from the submitted Blob. When the
        normalizer fails, the Version is quarantined with a Diagnostic on the
        Version read (or, on an optional text/* route, published through the
        built-in text path with provenance.normalization.fallback). Other media
        types are rejected with unverified_blob. provenance.normalization is
        engine-owned and rejected on input. Extension namespaces owned by the
        pinned plugin are written only by its normalizer output, published on
        the Version; a submission writing one, top-level or on a Part, is
        rejected with 422 extension_namespace_owned.
    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
    TextContent:
      type: object
      additionalProperties: false
      properties:
        kind:
          type: string
          enum:
            - text
        text:
          type: string
          minLength: 1
      required:
        - kind
        - text
    BlobContent:
      type: object
      additionalProperties: false
      properties:
        kind:
          type: string
          enum:
            - blob
        blob_id:
          type: string
          minLength: 1
        media_type:
          type: string
          minLength: 1
      required:
        - kind
        - blob_id
        - media_type
    ManifestContent:
      type: object
      additionalProperties: false
      properties:
        kind:
          type: string
          enum:
            - manifest
        parts:
          type: array
          items:
            $ref: '#/components/schemas/Part'
          minItems: 1
        relations:
          type: array
          items:
            $ref: '#/components/schemas/RelationInput'
      required:
        - kind
        - parts
      description: >-
        Unique Part keys, acyclic parent references within this Manifest, and
        verified same-Organization Blobs are checked before atomic publication.
        These semantic constraints need server validation in addition to JSON
        Schema.
    Extensions:
      type: object
      additionalProperties:
        type: object
        additionalProperties: false
        properties:
          schema_version:
            type: string
            minLength: 1
          data:
            type: object
            additionalProperties: true
        required:
          - schema_version
          - data
      description: >-
        Keys are plugin namespaces. Data is validated against the installed
        schema version; source data is not a computed Annotation.
    Provenance:
      type: object
      additionalProperties: false
      properties:
        source_blob_ids:
          type: array
          items:
            type: string
            minLength: 1
        producer:
          type: string
          minLength: 1
        producer_version:
          type: string
          minLength: 1
        normalization:
          $ref: '#/components/schemas/NormalizationProvenance'
      required: []
    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.
    Part:
      type: object
      additionalProperties: false
      properties:
        key:
          type: string
          minLength: 1
        parent_key:
          type: string
          minLength: 1
        role:
          type: string
          minLength: 1
        content:
          oneOf:
            - $ref: '#/components/schemas/TextContent'
            - $ref: '#/components/schemas/BlobContent'
        extensions:
          $ref: '#/components/schemas/Extensions'
      required:
        - key
        - role
        - content
    RelationInput:
      type: object
      additionalProperties: false
      properties:
        type:
          type: string
          minLength: 1
        target:
          $ref: '#/components/schemas/SourceIdentity'
        source_target_revision:
          type: string
          minLength: 1
      required:
        - type
        - target
      description: >-
        Source-provided link to an independently identified Record in the same
        Organization. Optional source revision preserves provenance; ordinary
        expansion resolves the current eligible target. Missing targets do not
        block readiness. Every expansion reauthorizes the target. Precise
        Part-target syntax remains outside this initial draft.
    NormalizationProvenance:
      type: object
      additionalProperties: false
      description: >-
        Engine-owned record of the external normalizer invocation whose output a
        Record Version publishes. Present only on read; a submission that sets
        it is rejected. producer and producer_version keep naming the acquirer,
        and source_blob_ids keeps the input Blob.
      properties:
        plugin_id:
          type: string
          minLength: 1
          maxLength: 64
        plugin_version:
          type: string
          minLength: 1
          maxLength: 64
        plugin_api:
          type: string
          minLength: 1
          maxLength: 32
          description: Plugin API version the engine invoked.
        contribution:
          type: string
          enum:
            - normalizer
        invocation_id:
          type: string
          minLength: 1
          maxLength: 128
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 256
        input_sha256:
          type: string
          pattern: ^[0-9a-f]{64}$
        fallback:
          type: object
          additionalProperties: false
          description: >-
            Present when the route is optional and the normalizer failed: the
            published Manifest comes from the built-in text path, and
            invocation_id names the failed invocation.
          properties:
            code:
              type: string
              minLength: 1
              maxLength: 64
            message:
              type: string
              minLength: 1
              maxLength: 1000
          required:
            - code
            - message
      required:
        - plugin_id
        - plugin_version
        - plugin_api
        - contribution
        - invocation_id
        - idempotency_key
        - input_sha256
  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.

````