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

# Publish the next product version

> Publishes the next version of an existing product as a whole-document write. A work-item product cannot become another type. Root and admin roles only.



## OpenAPI

````yaml /api-reference/endpoint/distribution/openapi.json patch /accounts/distribution-product
openapi: 3.1.0
info:
  title: quiva.ai Distribution API
  description: >-
    API for distributing products from a publisher account to distributor
    accounts: invitations, the distribution register, product definitions,
    messages between the two sides and config id reservations.
  version: 1.0.0
  contact:
    name: quiva.ai Support
    url: https://app.quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Distribution Invitations
    description: >-
      Mint, deliver, preview and redeem invitations that connect a distributor
      to a publisher
  - name: Distribution Register
    description: The register of distributions between a publisher and its distributors
  - name: Distributor Setup
    description: Distributor features, space template and space bindings
  - name: Distribution Products
    description: Product definitions and the products a distributor may work under
  - name: Distribution Messages
    description: Messages sent between the two sides of a distribution
  - name: Config Reservations
    description: Reservations of record config ids
paths:
  /accounts/distribution-product:
    patch:
      tags:
        - Distribution Products
      summary: Publish the next product version
      description: >-
        Publishes the next version of an existing product as a whole-document
        write. A work-item product cannot become another type. Root and admin
        roles only.
      operationId: updateDistributionProduct
      requestBody:
        required: true
        description: >-
          The whole product definition. A version is the definition as it stood;
          nothing is merged.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductDefinition'
      responses:
        '200':
          description: Product published
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/ProductVersionResult'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Nothing is published under that code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The product's entity config conflicts with a grant that carries it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DistributionRefusalResponse'
components:
  schemas:
    ProductDefinition:
      type: object
      description: 'A product: its record sets and the actions around them.'
      properties:
        code:
          type: string
        name:
          type: string
        type:
          type: string
        active:
          type: boolean
        record_configs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
        actions:
          type: object
          additionalProperties:
            type: array
            items:
              type: object
              additionalProperties: true
        sla_business_days:
          type: integer
        entity_config:
          type: object
          additionalProperties: true
        filing:
          type: object
          additionalProperties: true
        change_request:
          type: object
          additionalProperties: true
        distributor_front_page_layouts: {}
        version:
          type: integer
        publisher_account_id:
          type: string
        published_at:
          type: string
      required:
        - code
        - name
        - record_configs
        - actions
    ProductVersionResult:
      type: object
      properties:
        code:
          type: string
        version:
          type: integer
        product:
          $ref: '#/components/schemas/ProductDefinition'
    Error:
      type: object
      properties:
        error:
          type: string
    DistributionRefusalResponse:
      type: object
      description: >-
        A refusal by the distribution register. `refusal_code` names the reason
        so a caller can branch on it.
      properties:
        data:
          type: object
          properties:
            status:
              type: string
              description: Always `refused`
            refusal_code:
              type: string
            detail:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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