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

# Poll changes

> Same durable journal as SSE. Without cursor, return empty items and current committed position as next_cursor (start now). With cursor, return authorized events after it, in commit order; duplicates possible. Cursor binds Organization, Corpus filter and authorization scope. Expiry is 410 cursor_expired with resync_url, never silent reset; changed scope/filter is 409 cursor_scope_changed with resync_url. resync_url is the API-relative Record catalog route for the Corpus (/v0/records?corpus_id=...). next_cursor advances over scanned events even when none are visible. Public events are invalidations; reread current state, do not replay historical content into a current mirror.



## OpenAPI

````yaml /openapi.yaml get /v0/changes
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/changes:
    get:
      tags:
        - Changes
      summary: Poll changes
      description: >-
        Same durable journal as SSE. Without cursor, return empty items and
        current committed position as next_cursor (start now). With cursor,
        return authorized events after it, in commit order; duplicates possible.
        Cursor binds Organization, Corpus filter and authorization scope. Expiry
        is 410 cursor_expired with resync_url, never silent reset; changed
        scope/filter is 409 cursor_scope_changed with resync_url. resync_url is
        the API-relative Record catalog route for the Corpus
        (/v0/records?corpus_id=...). next_cursor advances over scanned events
        even when none are visible. Public events are invalidations; reread
        current state, do not replay historical content into a current mirror.
      operationId: pollChanges
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            minLength: 1
        - name: corpus_id
          in: query
          required: true
          schema:
            type: string
            minLength: 1
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangePage'
        default:
          description: Structured error; see contract HTTP mapping.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChangePage:
      type: object
      additionalProperties: false
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ChangeEvent'
        next_cursor:
          type: string
          minLength: 1
        has_more:
          type: boolean
      required:
        - items
        - next_cursor
        - has_more
    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
    ChangeEvent:
      type: object
      additionalProperties: false
      properties:
        event_id:
          type: string
          minLength: 1
        type:
          type: string
          minLength: 1
        schema_version:
          type: string
          minLength: 1
        occurred_at:
          type: string
          format: date-time
        resource:
          $ref: '#/components/schemas/ResourceReference'
        cursor:
          type: string
          minLength: 1
        monitoring:
          $ref: '#/components/schemas/MonitoringReferences'
      required:
        - event_id
        - type
        - schema_version
        - occurred_at
        - resource
        - cursor
      description: >-
        Every change to a Record catalog entry emits an event with
        resource.kind=record and resource.id=the affected Record ID. Additional
        resource-specific events do not replace this invalidation. Consumers
        reread current state; payload detail belongs to THE-547. Monitoring
        notice types mirror WebhookEvent and include monitoring references;
        event_id identifies that same committed notice. Delivery status changes
        emit delivery.updated events only to the feed, never recursive webhooks.
    ResourceReference:
      type: object
      additionalProperties: false
      properties:
        kind:
          type: string
          minLength: 1
        id:
          type: string
          minLength: 1
        corpus_id:
          type: string
          minLength: 1
      required:
        - kind
        - id
    MonitoringReferences:
      type: object
      additionalProperties: false
      properties:
        match_id:
          type: string
          minLength: 1
        record_id:
          type: string
          minLength: 1
        record_version_id:
          type: string
          minLength: 1
        subscription_id:
          type: string
          minLength: 1
        subscription_version_id:
          type: string
          minLength: 1
        delivery_id:
          type: string
          minLength: 1
        previous_match_id:
          type: string
          minLength: 1
        owner:
          $ref: '#/components/schemas/SubscriptionOwner'
      required:
        - match_id
        - record_id
        - record_version_id
        - subscription_id
        - subscription_version_id
        - delivery_id
      description: >-
        owner is the Subscription Owner, so a client routes the notice to its
        user; absent for a global Subscription and in notices committed before
        owners existed. match_id is the new Match for created/corrected, prior
        positive Match for no_longer_matches/withdrawn. record_version_id is the
        causal correction version for corrected/no_longer_matches, otherwise the
        matched version. References alone confer no access.
    SubscriptionOwner:
      type: string
      minLength: 1
      maxLength: 128
      description: >-
        Subscription Owner, an opaque end-user reference defined by the client
        application (for example user-123). Quivr stores, filters and echoes it
        without interpreting it. At most 128 characters without control
        characters; none is reserved for the listing filter (422 invalid_owner).
  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.

````