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

# Register Platform Provider Version

> Register a first-party provider version backed by a wheel.

Called by provider release CI after publishing a wheel to PyPI.
Authenticates against the Pragmatiks Console Clerk realm and
accepts only ConsoleMachine M2M tokens. The payload must target
``platform/<name>``; customer provider registration remains on the
customer-realm ``POST /provider-versions`` route.

Args:
    body: Wheel registration payload.
    machine: Authenticated ConsoleMachine performing the release.
    engine: Provider engine for registration persistence.

Returns:
    Persisted PUBLISHED ProviderVersion.

Raises:
    HTTPException: 403 when the payload targets a non-platform
        namespace; 422 when required metadata is missing.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json post /console/provider-versions
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /console/provider-versions:
    post:
      tags:
        - console
      summary: Register Platform Provider Version
      description: |-
        Register a first-party provider version backed by a wheel.

        Called by provider release CI after publishing a wheel to PyPI.
        Authenticates against the Pragmatiks Console Clerk realm and
        accepts only ConsoleMachine M2M tokens. The payload must target
        ``platform/<name>``; customer provider registration remains on the
        customer-realm ``POST /provider-versions`` route.

        Args:
            body: Wheel registration payload.
            machine: Authenticated ConsoleMachine performing the release.
            engine: Provider engine for registration persistence.

        Returns:
            Persisted PUBLISHED ProviderVersion.

        Raises:
            HTTPException: 403 when the payload targets a non-platform
                namespace; 422 when required metadata is missing.
      operationId: console-register_platform_provider_version
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WheelProviderVersionCreate'
        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:
    WheelProviderVersionCreate:
      properties:
        organization_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Organization Id
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        version:
          type: string
          title: Version
        wheel_url:
          type: string
          title: Wheel Url
        sha256:
          anyOf:
            - type: string
              pattern: ^[0-9a-f]{64}$
            - type: 'null'
          title: Sha256
        package_name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Package Name
        schemas:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Schemas
        metadata:
          anyOf:
            - $ref: '#/components/schemas/ProviderVersionMetadata'
            - type: 'null'
        config_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config Schema
        outputs_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Outputs Schema
        resource_schemas:
          additionalProperties:
            $ref: '#/components/schemas/ResourceSchemaResponse'
          type: object
          title: Resource Schemas
        changelog:
          anyOf:
            - type: string
            - type: 'null'
          title: Changelog
        entrypoint:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Entrypoint
      type: object
      required:
        - name
        - version
        - wheel_url
      title: WheelProviderVersionCreate
      description: |-
        Request body for the wheel-based provider publish route.

        Wheel-based publishing skips the in-API build step entirely: the
        publisher builds the wheel, runs schema extraction client-side,
        uploads the wheel to any HTTPS-reachable registry, then posts this
        payload to the API. The API persists a :class:`ProviderVersion`
        row pointing at the wheel and surfaces the schemas to dependents.

        Attributes:
            organization_id: Legacy organization id of the publishing
                tenant. Current SDKs send a canonical ``name`` instead.
            name: Canonical provider name (``"org/name"`` or
                ``"platform/name"``). Legacy clients may send only the
                provider short name together with ``organization_id``.
            version: Semantic version string (e.g. ``1.0.0``).
            wheel_url: HTTPS URL of the uploaded wheel. Any registry is
                accepted (PyPI, GitLab Package Registry, GCP Artifact
                Registry, private servers, …) as long as the URL ends in
                ``.whl`` and is reachable from the runtime container. The
                router normalises this to a canonical ``https://`` form.
            sha256: Optional wheel digest supplied by current SDKs. When
                present, the API verifies the wheel bytes before persisting
                and stores the digest for runtime install verification.
            package_name: Optional importable package name inside the wheel.
                Current SDKs omit this; runtimes can infer common wheel
                layouts, and future callers should send it explicitly.
            schemas: Current SDK resource-schema map keyed by resource type.
            metadata: Current SDK catalog display metadata for first publish
                and platform provider updates.
            config_schema: Legacy JSON Schema for the provider's top-level config
                block, extracted client-side. ``None`` when the provider
                exposes no top-level config.
            outputs_schema: JSON Schema for the provider's outputs block,
                extracted client-side. ``None`` when the provider exposes
                no outputs.
            resource_schemas: Per-resource schema map keyed by resource type
                name. Empty when the provider exposes no resource types.
            changelog: Optional release notes for this version.
            entrypoint: Optional override of the runtime entrypoint command.
                ``None`` preserves the default
                ``python -m pragma_runtime.entrypoint``.
    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
        runtime_version:
          type: string
          title: Runtime Version
        wheel_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Wheel Url
        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
        - runtime_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:
            runtime_version: Pinned runtime version this version targets.
            wheel_url: HTTPS URL of the published Python wheel. Sole
                artifact pointer for wheel-published versions; see
                :attr:`WheelProviderVersionCreate.wheel_url` for accepted
                registry forms.
            wheel_sha256: Optional SHA-256 digest of the wheel bytes,
                verified at publish time and forwarded to runtime installs.
            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
    ProviderVersionMetadata:
      properties:
        display_name:
          type: string
          maxLength: 100
          minLength: 1
          title: Display Name
        description:
          type: string
          maxLength: 500
          minLength: 1
          title: Description
        icon_url:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Icon Url
        tags:
          items:
            type: string
          type: array
          maxItems: 20
          title: Tags
      type: object
      required:
        - display_name
        - description
      title: ProviderVersionMetadata
      description: Catalog display fields supplied when registering a provider version.
    ResourceSchemaResponse:
      properties:
        provider:
          type: string
          title: Provider
        resource:
          type: string
          title: Resource
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        config_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config Schema
        outputs_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Outputs Schema
      type: object
      required:
        - provider
        - resource
      title: ResourceSchemaResponse
      description: |-
        Schema definition for a resource type exposed by a provider.

        Attributes:
            provider: Provider that exposes this resource type.
            resource: Resource type name.
            description: Human-readable description of the resource type.
            config_schema: JSON Schema for resource configuration.
            outputs_schema: JSON Schema for resource outputs.
    VersionStatus:
      type: string
      enum:
        - building
        - published
        - failed
        - yanked
      title: VersionStatus
      description: Build/publish 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

````