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

# Register plugin

> Register a plugin version the operator runs at an address. The request carries the exact quivr-plugin.yaml the plugin was built from, its endpoint and the settings it is installed with, with the shape and rules of a pin in the startup configuration (configuration, routes, kinds, spaces); plugin id and version come from the manifest. Quivr then checks it in the background with the Contract Runner against the endpoint, whose discovery must report the manifest's digest. The registration is registered while its check runs, then validated or rejected with the report. The same idempotency key returns the same registration; a key already used for another registration is 409 idempotency_conflict; a new key for a rejected registration checks it again. 422 invalid_plugin lists what the engine refuses in the manifest or settings. Requires plugins:admin.



## OpenAPI

````yaml /openapi.yaml post /v0/admin/plugins
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/admin/plugins:
    post:
      tags:
        - Admin
      summary: Register plugin
      description: >-
        Register a plugin version the operator runs at an address. The request
        carries the exact quivr-plugin.yaml the plugin was built from, its
        endpoint and the settings it is installed with, with the shape and rules
        of a pin in the startup configuration (configuration, routes, kinds,
        spaces); plugin id and version come from the manifest. Quivr then checks
        it in the background with the Contract Runner against the endpoint,
        whose discovery must report the manifest's digest. The registration is
        registered while its check runs, then validated or rejected with the
        report. The same idempotency key returns the same registration; a key
        already used for another registration is 409 idempotency_conflict; a new
        key for a rejected registration checks it again. 422 invalid_plugin
        lists what the engine refuses in the manifest or settings. Requires
        plugins:admin.
      operationId: registerPlugin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PluginRegistrationRequest'
      responses:
        '202':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginRegistration'
          headers:
            Location:
              description: >-
                The registration's read URL, which reports the check once it
                ran.
              schema:
                type: string
                format: uri-reference
        default:
          description: >-
            Structured error; 400 malformed, 401 unauthenticated, 403 without
            plugins:admin, 409 idempotency_conflict, 422 invalid_schema or
            invalid_plugin, 503 storage unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PluginRegistrationRequest:
      type: object
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 200
        endpoint:
          type: string
          minLength: 1
          maxLength: 2048
          description: >-
            Base URL where the operator runs the plugin, such as
            http://127.0.0.1:9900. A connector plugin needs https unless it is
            on loopback.
        manifest:
          type: string
          minLength: 1
          maxLength: 262144
          description: >-
            The exact text of the quivr-plugin.yaml the plugin was built from;
            its sha256 must be the manifest digest the plugin's discovery
            reports.
        configuration:
          type: object
          description: >-
            Plugin configuration, validated against the manifest's configuration
            schema.
        routes:
          type: array
          maxItems: 100
          description: Media types routed to the plugin's normalizer.
          items:
            type: object
            additionalProperties: false
            properties:
              media_type:
                type: string
                minLength: 1
              mode:
                type: string
                enum:
                  - required
                  - optional
            required:
              - media_type
        kinds:
          type: array
          maxItems: 100
          description: >-
            Alert kinds offered, a subset of those the manifest declares; absent
            offers them all.
          items:
            type: string
            minLength: 1
        spaces:
          type: object
          description: >-
            Vector spaces of an ingestion plugin by space id, served or
            evaluation; absent serves the only declared space.
          additionalProperties:
            type: string
            enum:
              - served
              - evaluation
      required:
        - idempotency_key
        - endpoint
        - manifest
    PluginRegistration:
      type: object
      additionalProperties: false
      properties:
        registration_id:
          type: string
          minLength: 1
        plugin_id:
          type: string
          minLength: 1
        version:
          type: string
          minLength: 1
        endpoint:
          type: string
          minLength: 1
          description: Base URL where the operator runs this plugin version.
        manifest_digest:
          type: string
          minLength: 1
        artifact_digest:
          type: string
          minLength: 1
          description: >-
            Artifact digest the plugin reports, recorded as information. Absent
            when it reports none.
        contributions:
          type: array
          items:
            type: string
        roles:
          type: array
          items:
            type: string
          description: >-
            Roles the manifest declares it can serve, such as
            normalizer:application/pdf, subscription:<plugin id> or
            connector:<kind>. The active plan says which it serves.
        state:
          type: string
          enum:
            - registered
            - validated
            - active
            - draining
            - inactive
            - rejected
          description: >-
            registered while the Contract Runner checks it, then validated or
            rejected; active while the active plan names it. Once a later plan
            leaves it out it is draining while pinned_work is above zero, then
            inactive.
        pinned_work:
          type: integer
          minimum: 0
          description: >-
            Unfinished work pinned to a Pipeline Plan that names this
            registration, such as the processing of a receipt, a connector run
            or a rebuild. Work finishes on the plan it started on, so a
            registration a plan change left out keeps being called until this
            reaches zero.
        check:
          $ref: '#/components/schemas/PluginCheckReport'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - registration_id
        - plugin_id
        - version
        - endpoint
        - manifest_digest
        - contributions
        - roles
        - state
        - pinned_work
        - created_at
        - updated_at
    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
    PluginCheckReport:
      type: object
      additionalProperties: false
      description: >-
        What the Contract Runner reported on a registration; certified plugins
        are validated.
      properties:
        certified:
          type: boolean
        checked_at:
          type: string
          format: date-time
        passed:
          type: integer
          minimum: 0
        failed:
          type: integer
          minimum: 0
        skipped:
          type: integer
          minimum: 0
        checks:
          type: array
          items:
            $ref: '#/components/schemas/PluginCheck'
      required:
        - certified
        - checked_at
        - passed
        - failed
        - skipped
        - checks
    PluginCheck:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          minLength: 1
        title:
          type: string
          minLength: 1
        contribution:
          type: string
          minLength: 1
        status:
          type: string
          enum:
            - pass
            - fail
            - skip
        issues:
          type: array
          items:
            $ref: '#/components/schemas/PluginIssue'
      required:
        - id
        - title
        - status
        - issues
    PluginIssue:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          minLength: 1
        path:
          type: string
        message:
          type: string
          minLength: 1
      required:
        - code
        - message
  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.

````