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

# Lookup records

> Read up to 100 Records, and optionally one Version of each, in one request. Each entry runs the same authorized reads as getRecord and, when version_id is given, getVersion: the same Organization, Corpus, Record ACL, archive and withdrawal rules apply, and an entry that is absent or inaccessible answers not_found exactly as the single read would. HTTP 200 carries one result per requested entry, in request order, with either the Record (and the Version when one was asked for) or the Error the single reads would have returned. A Record that resolves but whose requested Version does not reports that Version's Error and no Record. Repeated entries are answered independently. Clients that meet 404 or 405 on this route, such as during a rolling upgrade, can fall back to getRecord and getVersion.



## OpenAPI

````yaml /openapi.yaml post /v0/records/lookup
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/records/lookup:
    post:
      tags:
        - Records
      summary: Lookup records
      description: >-
        Read up to 100 Records, and optionally one Version of each, in one
        request. Each entry runs the same authorized reads as getRecord and,
        when version_id is given, getVersion: the same Organization, Corpus,
        Record ACL, archive and withdrawal rules apply, and an entry that is
        absent or inaccessible answers not_found exactly as the single read
        would. HTTP 200 carries one result per requested entry, in request
        order, with either the Record (and the Version when one was asked for)
        or the Error the single reads would have returned. A Record that
        resolves but whose requested Version does not reports that Version's
        Error and no Record. Repeated entries are answered independently.
        Clients that meet 404 or 405 on this route, such as during a rolling
        upgrade, can fall back to getRecord and getVersion.
      operationId: lookupRecords
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordLookupRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordLookupResult'
        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:
    RecordLookupRequest:
      type: object
      additionalProperties: false
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/RecordLookupEntry'
          minItems: 1
          maxItems: 100
      required:
        - items
    RecordLookupResult:
      type: object
      additionalProperties: false
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/RecordLookupItem'
          maxItems: 100
      required:
        - items
    Error:
      type: object
      additionalProperties: false
      properties:
        request_id:
          type: string
          description: Bounded caller X-Request-ID, or an engine-generated correlation ID.
        trace_id:
          type: string
          description: W3C trace ID when a trace context is present.
        span_id:
          type: string
          description: W3C span ID of the API handler when a trace context is present.
        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
    RecordLookupEntry:
      type: object
      additionalProperties: false
      properties:
        record_id:
          type: string
          minLength: 1
        version_id:
          type: string
          minLength: 1
          description: >-
            A Version of this Record to read as well, such as a search hit's
            version_id.
      required:
        - record_id
    RecordLookupItem:
      type: object
      additionalProperties: false
      properties:
        index:
          type: integer
          minimum: 0
          description: Position of the entry in the request.
        record:
          $ref: '#/components/schemas/Record'
        version:
          $ref: '#/components/schemas/Version'
        error:
          $ref: '#/components/schemas/Error'
      required:
        - index
      if:
        required:
          - record
      then:
        not:
          required:
            - error
      else:
        required:
          - error
        not:
          required:
            - version
    Record:
      type: object
      additionalProperties: false
      properties:
        record_id:
          type: string
          minLength: 1
        source:
          $ref: '#/components/schemas/SourceIdentity'
        withdrawn:
          type: boolean
        current_version_id:
          type: string
          minLength: 1
      required:
        - record_id
        - source
        - withdrawn
    Version:
      type: object
      additionalProperties: false
      properties:
        record_id:
          type: string
          minLength: 1
        version_id:
          type: string
          minLength: 1
        accepted_at:
          type: string
          format: date-time
          description: >-
            When Quivr accepted the revision this Version publishes, before any
            processing.
        manifest:
          $ref: '#/components/schemas/ManifestContent'
        extensions:
          $ref: '#/components/schemas/Extensions'
        provenance:
          $ref: '#/components/schemas/Provenance'
        availability:
          $ref: '#/components/schemas/Availability'
        relations:
          type: array
          items:
            $ref: '#/components/schemas/ResolvedRelation'
        processing:
          $ref: '#/components/schemas/ProcessingSummary'
        steps:
          $ref: '#/components/schemas/VersionSteps'
        diagnostics:
          type: array
          items:
            $ref: '#/components/schemas/Diagnostic'
          maxItems: 20
          description: >-
            Why the Version needs attention. A quarantined Version lists its
            reason first. A Version published through an optional route's
            fallback lists the normalizer failure it fell back from, and a
            recorded normalizer_conflict is listed on the Version whose output
            was kept. Omitted when there is nothing to report.
      required:
        - record_id
        - version_id
        - manifest
        - availability
        - relations
        - processing
    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
    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
    ResolvedRelation:
      type: object
      additionalProperties: false
      required:
        - source_reference
        - status
      properties:
        source_reference:
          $ref: '#/components/schemas/RelationInput'
        status:
          type: string
          enum:
            - available
            - unavailable
        target_record_id:
          type: string
        target_version_id:
          type: string
      description: >-
        Separate live view, not a mutation of the source Manifest. Unavailable
        covers missing, unready, withdrawn and inaccessible without
        distinguishing existence or revealing resolved target IDs.
      if:
        properties:
          status:
            const: available
      then:
        required:
          - target_record_id
          - target_version_id
      else:
        not:
          anyOf:
            - required:
                - target_record_id
            - required:
                - target_version_id
    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.
    VersionSteps:
      type: object
      additionalProperties: false
      description: >-
        When each processing step of the Version finished, written once by the
        transaction that commits the step. A step not finished yet is omitted.
        Versions materialized before step times were recorded carry only
        accepted_at, and withdrawn_at for a withdrawal after; history is not
        reconstructed.
      properties:
        accepted_at:
          type: string
          format: date-time
          description: Quivr accepted the revision.
        materialized_at:
          type: string
          format: date-time
          description: The Version was published from normalized content.
        segmented_at:
          type: string
          format: date-time
          description: The Version was first cut into segments.
        retrieval_ready_at:
          type: string
          format: date-time
          description: The Version first became searchable.
        enriched_at:
          type: string
          format: date-time
          description: Vectors were first attached to the Version.
        evaluated_at:
          type: string
          format: date-time
          description: >-
            Every Subscription asked to evaluate the Version had decided; one
            that waits for vectors decides on their round. Omitted when no
            Subscription evaluated it, or when one waiting for vectors was
            disabled before they arrived. With more than 100 Subscriptions on
            one Corpus it can be set once the first 100 have decided.
        quarantined_at:
          type: string
          format: date-time
          description: The Version was quarantined.
        withdrawn_at:
          type: string
          format: date-time
          description: The Version's Record was withdrawn.
    Diagnostic:
      type: object
      additionalProperties: false
      description: >-
        A structured processing diagnostic. plugin, contribution and
        invocation_id name the external

        invocation a normalization diagnostic concerns. Codes of external
        normalization:


        - normalizer_failed: the normalizer answered a terminal error. The
        Version is quarantined.

        - normalizer_invalid_output: the output broke the Plugin Protocol or the
        Manifest rules (schema,
          malformed or duplicate Part, a Blob Part that is not the input Blob or has another checksum,
          an undeclared extension namespace, too many Parts, a response over the size bound). Nothing
          from it is published; the Version is quarantined.
        - normalizer_timeout: the invocations kept exceeding the timeout until
        the retry budget (the
          manifest's retry.max_attempts, capped by the engine at 5) was spent. The Version is quarantined.
        - normalizer_retries_exhausted: the normalizer kept answering retryable
        errors until the retry
          budget was spent. The Version is quarantined.
        - input_unverified: the input Blob was no longer the verified accepted
        input. The Version is
          quarantined.
        - normalizer_unrouted: the media type's route was removed after
        acceptance and the built-in text
          path cannot read it (a text/* Blob takes the built-in text path instead). The Version is
          quarantined.
        - normalization_superseded: a newer revision of the Record was accepted
        before this Version was
          normalized, so the normalizer was not invoked. The Version is quarantined and never current.
        - normalizer_conflict: a later invocation with the same idempotency key
        returned a different
          output. The first recorded output is kept and published; nothing is overwritten.

        On an optional route every quarantining code above that comes from the
        normalizer is instead

        listed on a searchable Version published through the built-in text path.
        A plugin that is

        unavailable (connection failure, 5xx without an error envelope,
        discovery that does not match the

        pinned manifest) is retried with backoff. Live imports, including
        normalization, produce no

        diagnostic for these outages even after the plugin leaves the active
        Pipeline Plan; the Receipt

        shows plugin_unavailable while it retries.


        - pinned_plugin_unavailable: an older plan's plugin exhausted the
        deployment's attempt budget
          during an Operation or after ingestion invocation deadlines, or its ingestion owner could no
          longer serve the work. Live imports
          and normalization now retain their pin and retry reachability outages until the exact build
          returns; they never silently move to its replacement. A Version with this diagnostic is
          quarantined, or keeps its searchable text while enrichment stops. plan, plugin and
          plugin_version name the original plan and plugin.
        - pinned_plan_stopped: the processing of this Version started on a
        Pipeline Plan that an operator
          rolled back with pinned_work=stop. At its next call to a plugin that left the active plan, the
          work stopped instead of calling it, with the same outcome and fields as
          pinned_plugin_unavailable.

        Quarantined Versions keep their input reference and reason. An operator
        lists them and reprocesses

        them with the active plan (listQuarantinedVersions,
        reprocessQuarantine); a reprocess that fails

        again replaces the reason.
      properties:
        code:
          type: string
          minLength: 1
        message:
          type: string
          minLength: 1
        retryable:
          type: boolean
          description: Whether the same input may succeed if processed again.
        plugin:
          type: string
          minLength: 1
          description: Plugin id of the invocation.
        plugin_version:
          type: string
          minLength: 1
          description: >-
            Plugin version of a pinned_plugin_unavailable or pinned_plan_stopped
            diagnostic.
        plan:
          type: string
          minLength: 1
          description: >-
            Pipeline Plan the stopped work was pinned to, in a
            pinned_plugin_unavailable or pinned_plan_stopped diagnostic.
        contribution:
          type: string
          minLength: 1
        invocation_id:
          type: string
          minLength: 1
      required:
        - code
        - message
        - retryable
    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
          description: >-
            Present when import audit detail is retained, or when it identifies
            a failed invocation. Omitted for successful normalization without
            audit detail.
        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
        - idempotency_key
        - input_sha256
      allOf:
        - if:
            required:
              - fallback
          then:
            required:
              - invocation_id
    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
  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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.