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

# Publish Provider Version

> Publish a provider version by streaming its wheel through the API.

The publisher (``pragma providers publish``) runs ``uv build`` and posts
the wheel as a multipart request: the wheel file part ``wheel`` plus a
JSON ``metadata`` form field decoded into :class:`WheelUploadMetadata`.
The API validates the filename, size, and version before streaming the
bytes into the owned registry, computing the sha256 over the same pass,
and persisting a PUBLISHED :class:`ProviderVersion`. The API hosts the
wheel and computes the digest, so the request carries neither a wheel URL
nor a client ``sha256``, and the package name is derived from the wheel
filename.

Returns:
    Persisted PUBLISHED ProviderVersion record.

Raises:
    HTTPException: 400/413/422 when the wheel filename, size, version, or
        metadata fail validation, or 403 when the provider namespace does
        not match the authenticated user's organization.
    ProviderVersionImmutableError: 409 when the version already exists.
    WheelRegistryNotConfiguredError: 503 when no registry is configured.
    WheelRegistryUploadError: 502 when the registry push fails upstream.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json post /providers/publish
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /providers/publish:
    post:
      tags:
        - providers
      summary: Publish Provider Version
      description: >-
        Publish a provider version by streaming its wheel through the API.


        The publisher (``pragma providers publish``) runs ``uv build`` and posts

        the wheel as a multipart request: the wheel file part ``wheel`` plus a

        JSON ``metadata`` form field decoded into :class:`WheelUploadMetadata`.

        The API validates the filename, size, and version before streaming the

        bytes into the owned registry, computing the sha256 over the same pass,

        and persisting a PUBLISHED :class:`ProviderVersion`. The API hosts the

        wheel and computes the digest, so the request carries neither a wheel
        URL

        nor a client ``sha256``, and the package name is derived from the wheel

        filename.


        Returns:
            Persisted PUBLISHED ProviderVersion record.

        Raises:
            HTTPException: 400/413/422 when the wheel filename, size, version, or
                metadata fail validation, or 403 when the provider namespace does
                not match the authenticated user's organization.
            ProviderVersionImmutableError: 409 when the version already exists.
            WheelRegistryNotConfiguredError: 503 when no registry is configured.
            WheelRegistryUploadError: 502 when the registry push fails upstream.
      operationId: providers-publish_provider_version
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_providers-publish_provider_version'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderVersion'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_providers-publish_provider_version:
      properties:
        metadata:
          type: string
          title: Metadata
        wheel:
          type: string
          contentMediaType: application/octet-stream
          title: Wheel
      type: object
      required:
        - metadata
        - wheel
      title: Body_providers-publish_provider_version
    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_sha256:
          anyOf:
            - type: string
              pattern: ^[0-9a-f]{64}$
            - type: 'null'
          title: Wheel Sha256
        package_name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Package Name
        entrypoint:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Entrypoint
        source_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Hash
        build_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Build Id
        schemas:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Schemas
        changelog:
          anyOf:
            - type: string
            - type: 'null'
          title: Changelog
        status:
          $ref: '#/components/schemas/VersionStatus'
          default: building
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
        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
        - canonical
      title: ProviderVersion
      description: |-
        A published version of a provider.

        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").

        Build metadata:
            wheel_sha256: SHA-256 digest of the wheel bytes, computed
                server-side at publish time as a catalog audit field.
            package_name: Optional importable Python package name inside a
                wheel-published provider. When absent, the runtime attempts
                to infer it from installed wheel metadata.
            entrypoint: Optional override of the runtime entrypoint command
                (e.g. ``["python", "-m", "custom_runtime"]``). ``None`` keeps
                the default ``python -m pragma_runtime.entrypoint``.
            source_hash: SHA-256 of the source tarball on legacy rows.

        Provider introspection:
            schemas: Resource type schemas extracted from the provider.

        State (system-managed):
            status: Build/publish lifecycle status.
            published_at: Timestamp when version was published.
            error_message: Error details when build fails.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VersionStatus:
      type: string
      enum:
        - building
        - published
        - failed
        - yanked
      title: VersionStatus
      description: Publish lifecycle status for a provider version.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````