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

# Replace a policy version in a bundle

> Atomically deactivates the current policy version and activates a new version. Set preview=true to get the impact without making changes.



## OpenAPI

````yaml /api-specs/cloud/governance-api.json post /rpc/upgrade-bundle-policy
openapi: 3.0.3
info:
  description: Service responsible for managing Domino Governance feature
  title: Domino Governance API
  contact:
    name: Domino Data Lab
    url: https://tickets.dominodatalab.com/hc/en-us
    email: support@dominodatalab.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://mycluster.domino.tech/api/governance/v1
    description: >-
      Replace 'mycluster.domino.tech' with your Domino cluster hostname. For
      Domino Cloud customers, that is `your-subdomain`.domino.tech (e.g.,
      acme.domino.tech). For self-hosted deployments, it is the hostname you
      reach the Domino UI at.
security: []
paths:
  /rpc/upgrade-bundle-policy:
    post:
      tags:
        - bundles
      summary: Replace a policy version in a bundle
      description: >-
        Atomically deactivates the current policy version and activates a new
        version. Set preview=true to get the impact without making changes.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/server.UpgradeBundlePolicyRequest'
        description: Request to replace policy version
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/guardrails.PolicyVersionUpgradePlan'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
components:
  schemas:
    server.UpgradeBundlePolicyRequest:
      type: object
      required:
        - bundleId
        - currentPolicyVersionId
        - newPolicyVersionId
      properties:
        bundleId:
          type: string
        currentPolicyVersionId:
          type: string
        newPolicyVersionId:
          type: string
        preview:
          type: boolean
    guardrails.PolicyVersionUpgradePlan:
      type: object
      properties:
        approvals:
          $ref: '#/components/schemas/guardrails.PolicyVersionUpgradeApprovalPlan'
        findings:
          $ref: '#/components/schemas/guardrails.PolicyVersionUpgradeFindingPlan'
        policyVersionDiffSummary:
          $ref: '#/components/schemas/guardrails.PolicyVersionDiffSummary'
        results:
          $ref: '#/components/schemas/guardrails.PolicyVersionUpgradeResultPlan'
        stage:
          $ref: >-
            #/components/schemas/guardrails.PolicyVersionUpgradeAssignedStagePlan
        stageAssignees:
          $ref: >-
            #/components/schemas/guardrails.PolicyVersionUpgradeStageAssigneesPlan
    server.HTTPError:
      type: object
      properties:
        code:
          description: >-
            Code is a stable machine-readable error identifier; absent on most
            errors.
          allOf:
            - $ref: '#/components/schemas/guardrails.ErrorCode'
        message:
          type: string
    guardrails.PolicyVersionUpgradeApprovalPlan:
      type: object
      properties:
        lost:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.ApprovalTransfer'
        transferable:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.ApprovalTransfer'
    guardrails.PolicyVersionUpgradeFindingPlan:
      type: object
      properties:
        lost:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.FindingTransfer'
        transferable:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.FindingTransfer'
    guardrails.PolicyVersionDiffSummary:
      type: object
      properties:
        approvals:
          $ref: '#/components/schemas/guardrails.DiffSummaryCount'
        artifacts:
          $ref: '#/components/schemas/guardrails.DiffSummaryCount'
        stages:
          $ref: '#/components/schemas/guardrails.DiffSummaryCount'
    guardrails.PolicyVersionUpgradeResultPlan:
      type: object
      properties:
        lost:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.ResultTransfer'
        transferable:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.ResultTransfer'
    guardrails.PolicyVersionUpgradeAssignedStagePlan:
      type: object
      properties:
        reason:
          type: string
        source:
          type: string
        target:
          type: string
    guardrails.PolicyVersionUpgradeStageAssigneesPlan:
      type: object
      properties:
        lost:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.StageAssigneeTransfer'
        transferable:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.StageAssigneeTransfer'
    guardrails.ErrorCode:
      type: string
      enum:
        - BUNDLE_REQUIRES_POLICY
      x-enum-varnames:
        - CodeBundleRequiresPolicy
    guardrails.ApprovalTransfer:
      type: object
      properties:
        actionMeta:
          $ref: '#/components/schemas/guardrails.ActionMeta'
        approvers:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.Approver'
        reason:
          type: string
        requiredFindingIds:
          type: array
          items:
            type: string
        result:
          $ref: '#/components/schemas/guardrails.Result'
        revalidation:
          $ref: '#/components/schemas/guardrails.Revalidation'
        source:
          $ref: '#/components/schemas/guardrails.ApprovalTransferInfo'
        status:
          $ref: '#/components/schemas/guardrails.ApprovalStatus'
        target:
          $ref: '#/components/schemas/guardrails.ApprovalTransferInfo'
    guardrails.FindingTransfer:
      type: object
      properties:
        actionMeta:
          $ref: '#/components/schemas/guardrails.ActionMeta'
        approver:
          $ref: '#/components/schemas/guardrails.FindingUser'
        assignee:
          $ref: '#/components/schemas/guardrails.FindingUser'
        description:
          type: string
        dueDate:
          type: string
        name:
          type: string
        reason:
          type: string
        required:
          type: boolean
        severity:
          $ref: '#/components/schemas/guardrails.FindingSeverity'
        source:
          $ref: '#/components/schemas/guardrails.FindingTransferInfo'
        status:
          $ref: '#/components/schemas/guardrails.FindingStatus'
        target:
          $ref: '#/components/schemas/guardrails.FindingTransferInfo'
        taskId:
          type: string
        updateActionMeta:
          $ref: '#/components/schemas/guardrails.ActionMeta'
    guardrails.DiffSummaryCount:
      type: object
      properties:
        added:
          type: integer
        changed:
          type: integer
        removed:
          type: integer
    guardrails.ResultTransfer:
      type: object
      properties:
        actionMeta:
          $ref: '#/components/schemas/guardrails.ActionMeta'
        content: {}
        reason:
          type: string
        source:
          $ref: '#/components/schemas/guardrails.ArtifactContentTransferInfo'
        target:
          $ref: '#/components/schemas/guardrails.ArtifactContentTransferInfo'
    guardrails.StageAssigneeTransfer:
      type: object
      properties:
        assignee:
          $ref: '#/components/schemas/guardrails.BundleStageAssignee'
        reason:
          type: string
        source:
          $ref: '#/components/schemas/guardrails.StageAssigneeTransferInfo'
        target:
          $ref: '#/components/schemas/guardrails.StageAssigneeTransferInfo'
    guardrails.ActionMeta:
      type: object
      properties:
        date:
          type: string
        sourceEntityId:
          type: string
        user:
          $ref: '#/components/schemas/guardrails.User'
    guardrails.Approver:
      type: object
      required:
        - editable
        - id
        - name
        - showByDefault
      properties:
        editable:
          type: boolean
        fromOrganizationUserId:
          type: string
        id:
          type: string
        isOrganizationUser:
          type: boolean
        name:
          type: string
        showByDefault:
          type: boolean
    guardrails.Result:
      type: object
      required:
        - content
        - evidenceId
      properties:
        content:
          $ref: '#/components/schemas/guardrails.Content'
        evidenceId:
          type: string
    guardrails.Revalidation:
      type: object
      properties:
        createdAt:
          type: string
        createdBy:
          $ref: '#/components/schemas/guardrails.User'
        firstApprovedAt:
          type: string
        isOverride:
          type: boolean
        nextDeadlineAt:
          type: string
        revalidationConfig:
          $ref: '#/components/schemas/guardrails.RevalidationConfig'
        revalidationPeriodStartsAt:
          type: string
        updatedAt:
          type: string
        updatedBy:
          $ref: '#/components/schemas/guardrails.User'
    guardrails.ApprovalTransferInfo:
      type: object
      properties:
        stageApprovalId:
          type: string
    guardrails.ApprovalStatus:
      type: string
      enum:
        - PendingSubmission
        - PendingReview
        - Approved
        - ConditionallyApproved
        - PendingExpiration
        - Expired
      x-enum-varnames:
        - PendingSubmission
        - PendingReview
        - Approved
        - ConditionallyApproved
        - PendingExpiration
        - Expired
    guardrails.FindingUser:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
    guardrails.FindingSeverity:
      type: string
      enum:
        - S0
        - S1
        - S2
        - S3
      x-enum-varnames:
        - S0
        - S1
        - S2
        - S3
    guardrails.FindingTransferInfo:
      type: object
      properties:
        approvalId:
          type: string
        artifactId:
          type: string
        evidenceId:
          type: string
        findingId:
          type: string
    guardrails.FindingStatus:
      type: string
      enum:
        - ToDo
        - InProgress
        - InReview
        - Done
        - WontDo
      x-enum-varnames:
        - ToDo
        - InProgress
        - InReview
        - Done
        - WontDo
    guardrails.ArtifactContentTransferInfo:
      type: object
      properties:
        artifactId:
          type: string
        belongsToApproval:
          type: boolean
        evidenceId:
          type: string
    guardrails.BundleStageAssignee:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
    guardrails.StageAssigneeTransferInfo:
      type: object
      properties:
        stageId:
          type: string
        stageName:
          type: string
    guardrails.User:
      type: object
      properties:
        firstName:
          type: string
        id:
          type: string
        lastName:
          type: string
        userName:
          type: string
    guardrails.Content:
      type: object
      additionalProperties: {}
    guardrails.RevalidationConfig:
      type: object
      required:
        - openWindowDaysBefore
        - recurring
        - type
      properties:
        openWindowDaysBefore:
          type: integer
          minimum: 1
        recurring:
          $ref: '#/components/schemas/guardrails.Recurring'
        type:
          enum:
            - absolute
            - relative
          allOf:
            - $ref: '#/components/schemas/guardrails.RevalidationType'
    guardrails.Recurring:
      type: object
      required:
        - every
        - unit
      properties:
        every:
          type: integer
          minimum: 1
        startDate:
          type: string
        unit:
          enum:
            - month
            - year
          allOf:
            - $ref: '#/components/schemas/guardrails.RevalidationUnit'
    guardrails.RevalidationType:
      type: string
      enum:
        - absolute
        - relative
      x-enum-varnames:
        - RevalidationTypeAbsolute
        - RevalidationTypeRelative
    guardrails.RevalidationUnit:
      type: string
      enum:
        - month
        - year
      x-enum-varnames:
        - RevalidationUnitMonth
        - RevalidationUnitYear

````

## Related topics

- [Replace a bundle's primary policy with a different policy](/api-reference/bundles/replace-a-bundles-primary-policy-with-a-different-policy.md)
- [Define policies](/cloud/platform-capabilities/features/governance/define-governance-policies/index.md)
- [Update the policy of a bundle](/api-reference/bundles/update-the-policy-of-a-bundle.md)
- [Policy components](/cloud/platform-capabilities/features/governance/define-governance-policies/policy-components.md)
