> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pragmatiks.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Provider Wheel

> Upload the wheel of a declared provider version.

The request body is the wheel file declared by ``POST /providers/publish``.
Once accepted, the version is admitted on the organization's provider
host; poll it until it is ``published`` or ``failed``, where
``error_message`` says why. While the platform is taking as many
wheels as it can, the upload is refused with ``503`` and the version
is unchanged; upload it again after ``Retry-After``.

Returns:
    The version; when this upload is accepted, ``staged`` or further
    along its admission.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json put /providers/publish/{operation_id}/wheel
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /providers/publish/{operation_id}/wheel:
    put:
      tags:
        - providers
      summary: Upload Provider Wheel
      description: >-
        Upload the wheel of a declared provider version.


        The request body is the wheel file declared by ``POST
        /providers/publish``.

        Once accepted, the version is admitted on the organization's provider

        host; poll it until it is ``published`` or ``failed``, where

        ``error_message`` says why. While the platform is taking as many

        wheels as it can, the upload is refused with ``503`` and the version

        is unchanged; upload it again after ``Retry-After``.


        Returns:
            The version; when this upload is accepted, ``staged`` or further
            along its admission.
      operationId: providers-upload_provider_wheel
      parameters:
        - name: operation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Operation Id
      responses:
        '200':
          description: >-
            The wheel was already uploaded by an earlier request; nothing is
            stored and the version is returned as it stands.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderVersion'
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderVersion'
        '400':
          description: The upload is not a readable wheel. The version is failed.
        '409':
          description: >-
            This publish was replaced or has finished. Run 'pragma providers
            publish' again.
        '413':
          description: >-
            The wheel expands to more than 256 MiB. Reduce its size and publish
            it again. The version is failed.
        '422':
          description: >-
            The operation id is not a UUID or the uploaded wheel is not the
            wheel this publish declared, and the version is unchanged; or the
            wheel does not match its declaration, and the version is failed.
        '503':
          description: >-
            Could not take the wheel right now: the platform is taking as many
            wheels as it can (`staging_full`) or could not store the wheel
            (`staging_unavailable`). The version is unchanged. Upload it again
            later.
components:
  schemas:
    ProviderVersion:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        prefix:
          type: string
          title: Prefix
        name:
          type: string
          title: Name
        version:
          type: string
          title: Version
        wheel_filename:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Wheel Filename
        wheel_sha256:
          anyOf:
            - type: string
              pattern: ^[0-9a-f]{64}$
            - type: 'null'
          title: Wheel Sha256
        distribution_name:
          type: string
          maxLength: 200
          minLength: 1
          title: Distribution Name
        package:
          anyOf:
            - type: string
            - type: 'null'
          title: Package
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        keywords:
          items:
            type: string
          type: array
          title: Keywords
        schemas:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Schemas
        python_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Python Version
        sdk_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Sdk Version
        protocol_versions:
          items:
            type: integer
          type: array
          title: Protocol Versions
        embedded_providers:
          additionalProperties:
            type: string
          type: object
          title: Embedded Providers
        operation_deadline_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Operation Deadline At
        changelog:
          anyOf:
            - type: string
            - type: 'null'
          title: Changelog
        status:
          $ref: '#/components/schemas/VersionStatus'
          default: awaiting_wheel
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
        failure_category:
          anyOf:
            - $ref: '#/components/schemas/AdmissionFailureCategory'
            - type: 'null'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        canonical:
          type: string
          title: Canonical
          description: >-
            Slash-joined ``prefix/name`` canonical string of the owning
            provider.


            Returns:
                Display form of the provider identity this version belongs to.
          readOnly: true
      type: object
      required:
        - prefix
        - name
        - version
        - distribution_name
        - canonical
      title: ProviderVersion
      description: |-
        One version of a provider, from upload through admission.

        The declaration fields, admission inputs, ``organization_id``,
        ``stream_sequence``, ``operation_id``, ``lock``, ``pyproject`` and
        ``operation_type`` are stored but never serialized.

        Identity fields (frozen):
            prefix: Namespace token of the owning provider.
            name: Provider short name this version belongs to.
            version: Semantic version string (e.g., "1.0.0").

        Wheel:
            wheel_filename: Filename of the wheel as renamed to the owner's
                distribution name; the registry stores the wheel under it.
            wheel_sha256: SHA-256 digest of the wheel bytes as renamed to
                the owner's distribution name; ``None`` until ``staged``.
            distribution_name: Wheel distribution name the version is
                published under, ``<prefix>-<name>`` canonicalized.
            package: Importable package that holds the provider.
            summary: Core-metadata summary of the wheel, used as the catalog
                description when the version creates the provider.
            keywords: Core-metadata keywords of the wheel, used as the catalog
                tags when the version creates the provider.

        Declaration:
            declared_sha256: SHA-256 digest of the wheel as built, before the
                rename; the upload must match it.
            declared_size: Size in bytes of the wheel as built.
            declared_dist_info_sha256: SHA-256 digest over the declared
                ``METADATA`` and ``entry_points.txt`` bytes, each prefixed with
                its length; the uploaded wheel's files must match it.
            dist_info_directory: Declared name of the wheel's ``.dist-info``
                directory.

        Admission inputs:
            organization_id: Organization that declared the version.
            requires_python: Normalized Requires-Python specifier of the
                wheel, or ``None`` when it declares none.
            registry_pins: Canonical distribution names the version resolves
                only from the Pragmatiks registry, computed at publish.
            declared_embeds: Canonical distribution names the wheel declares
                under ``pragma.embeds``.

        Admission results:
            schemas: Resource type schemas reported by introspection, each
                keyed on ``"resource"``.
            python_version: Exact Python (``"3.14.2"``) the version was
                admitted on and installs on.
            pyproject: ``pyproject.toml`` text admission locked, which the
                version installs from with its lock.
            lock: Resolved ``uv.lock`` text the version installs from.
            sdk_version: Pragmatiks SDK version the lock resolved.
            protocol_versions: Host protocol versions the provider speaks.
            embedded_providers: Pragmatiks providers the version installs,
                distribution name to locked version.

        Operation (system-managed):
            operation_id: Publish operation in flight, issued at declaration;
                the wheel is uploaded to it, and every later write must match it.
            operation_type: Kind of operation in flight, always ``publish``.
            operation_deadline_at: When the admission must finish; set when
                the provider host first takes it.
            stream_sequence: Sequence of the admission request message the
                provider host took, recorded at ``admitting``.

        State (system-managed):
            changelog: Release notes supplied at publish.
            status: Publish lifecycle status.
            published_at: Timestamp when the version was published.
            failure_category: Why admission failed, when ``failed``.
            error_message: User-facing failure message, when ``failed``.
    VersionStatus:
      type: string
      enum:
        - awaiting_wheel
        - staged
        - queued
        - admitting
        - promoting
        - published
        - failed
      title: VersionStatus
      description: |-
        Publish lifecycle status for a provider version.

        A declared version is ``awaiting_wheel`` until its wheel is uploaded,
        then ``staged``, ``queued`` for the organization's provider host,
        ``admitting`` while the host admits it, and ``promoting`` while the
        admitted wheel is copied to the registry. It ends ``published``
        (terminal) or ``failed``; a failed version may be published again
        under the same version number.
    AdmissionFailureCategory:
      type: string
      enum:
        - wheel_refused
        - wheel_lost
        - digest_mismatch
        - python_unavailable
        - dependency_resolution_failed
        - undeclared_embedded_provider
        - unregistered_embedded_provider
        - embedded_provider_not_depended_on
        - unsupported_protocol
        - import_failed
        - missing_observe
        - stored_wheel_conflict
        - deadline_exceeded
        - platform_error
        - organization_deleted
      title: AdmissionFailureCategory
      description: Why a provider version failed admission.

````

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