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

# Diff two policy versions

> Compute the diff between two policy versions (source and target)



## OpenAPI

````yaml /api-specs/cloud/public-api.json get /api/governance/v1/policy-versions/{id}/diff/{targetId}
openapi: 3.0.3
info:
  title: Domino Public API
  description: Reference for Domino's public REST API endpoints.
  version: 6.4.0
  x-catalog-key: nucleus
servers:
  - url: https://mycluster.domino.tech
    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: []
tags:
  - name: Projects
  - name: Project templates
  - name: Workspaces
  - name: Jobs
  - name: HPC Jobs
  - name: Environments
  - name: Hardware Tiers
  - name: Datasets
  - name: Data Sources
  - name: GenAI
  - name: AI Systems
  - name: Apps
  - name: App versions
  - name: App instances
  - name: Model APIs
  - name: Registered models
  - name: Model deployment
  - name: Extensions
  - name: Cost and billing
  - name: Users and organizations
  - name: Service accounts
  - name: Personal Access Tokens
  - name: Personal Access Tokens (admin)
  - name: Audit Trail
  - name: Custom metrics
  - name: PPM
  - name: Model Monitoring models
  - name: Model Monitoring drift and quality
  - name: Model Monitoring settings
  - name: Model Monitoring authentication
  - name: Governance bundles
  - name: Governance policies
  - name: Governance evidence and results
  - name: Governance operations
  - name: NetApp Volumes
  - name: NetApp Volumes snapshots
  - name: NetApp Volumes filesystems
  - name: NetApp Volumes transfers
  - name: Tags
  - name: Properties
externalDocs:
  description: OpenAPI
  url: https://swagger.io/resources/open-api/
paths:
  /api/governance/v1/policy-versions/{id}/diff/{targetId}:
    get:
      tags:
        - Governance policies
      summary: Diff two policy versions
      description: Compute the diff between two policy versions (source and target)
      parameters:
        - description: ID of the source policy version
          name: id
          in: path
          required: true
          schema:
            type: string
        - description: ID of the target policy version
          name: targetId
          in: path
          required: true
          schema:
            type: string
        - description: Include unchanged artifacts/approvals in the diff
          name: includeUnchanged
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/rai-guardrails-service_guardrails.PolicyDiffResult
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rai-guardrails-service_server.HTTPError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rai-guardrails-service_server.HTTPError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rai-guardrails-service_server.HTTPError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rai-guardrails-service_server.HTTPError'
components:
  schemas:
    rai-guardrails-service_guardrails.PolicyDiffResult:
      type: object
      properties:
        approvals:
          type: array
          items:
            $ref: >-
              #/components/schemas/rai-guardrails-service_guardrails.ApprovalDiff
        artifacts:
          type: array
          items:
            $ref: >-
              #/components/schemas/rai-guardrails-service_guardrails.ArtifactDiff
        policy_id:
          type: string
        source:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.PolicyDiffVersionInfo
        stages:
          type: array
          items:
            $ref: '#/components/schemas/rai-guardrails-service_guardrails.StageDiff'
        target:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.PolicyDiffVersionInfo
    rai-guardrails-service_server.HTTPError:
      type: object
      properties:
        code:
          description: >-
            Code is a stable machine-readable error identifier; absent on most
            errors.
          allOf:
            - $ref: '#/components/schemas/rai-guardrails-service_guardrails.ErrorCode'
        message:
          type: string
    rai-guardrails-service_guardrails.ApprovalDiff:
      type: object
      properties:
        changes:
          type: array
          items:
            $ref: >-
              #/components/schemas/rai-guardrails-service_guardrails.ApprovalChangeKind
        policyEntityId:
          type: string
        source:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.ApprovalProperties
        target:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.ApprovalProperties
        type:
          $ref: '#/components/schemas/rai-guardrails-service_guardrails.DiffType'
    rai-guardrails-service_guardrails.ArtifactDiff:
      type: object
      properties:
        changes:
          type: array
          items:
            $ref: >-
              #/components/schemas/rai-guardrails-service_guardrails.ArtifactChangeKind
        policyEntityId:
          type: string
        source:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.ArtifactProperties
        target:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.ArtifactProperties
        type:
          $ref: '#/components/schemas/rai-guardrails-service_guardrails.DiffType'
    rai-guardrails-service_guardrails.PolicyDiffVersionInfo:
      type: object
      properties:
        policy_version_id:
          type: string
        version:
          type: string
    rai-guardrails-service_guardrails.StageDiff:
      type: object
      properties:
        changes:
          type: array
          items:
            $ref: >-
              #/components/schemas/rai-guardrails-service_guardrails.StageChangeKind
        policyEntityId:
          type: string
        source:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.StageProperties
        target:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.StageProperties
        type:
          $ref: '#/components/schemas/rai-guardrails-service_guardrails.DiffType'
    rai-guardrails-service_guardrails.ErrorCode:
      type: string
      enum:
        - BUNDLE_REQUIRES_POLICY
      x-enum-varnames:
        - CodeBundleRequiresPolicy
    rai-guardrails-service_guardrails.ApprovalChangeKind:
      type: string
      enum:
        - moved
        - name_changed
        - approvers_changed
        - evidence_added
        - evidence_removed
        - evidence_changed
      x-enum-varnames:
        - ApprovalChangeKindMoved
        - ApprovalChangeKindNameChanged
        - ApprovalChangeKindApproversChanged
        - ApprovalChangeKindEvidenceAdded
        - ApprovalChangeKindEvidenceRemoved
        - ApprovalChangeKindEvidenceChanged
    rai-guardrails-service_guardrails.ApprovalProperties:
      type: object
      properties:
        approvers:
          type: array
          items:
            $ref: '#/components/schemas/rai-guardrails-service_guardrails.Approver'
        artifacts:
          type: array
          items:
            $ref: >-
              #/components/schemas/rai-guardrails-service_guardrails.ApprovalArtifactProperties
        evidenceId:
          type: string
        location:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.DiffApprovalLocation
        name:
          type: string
        policyEntityId:
          type: string
        stageApprovalId:
          type: string
    rai-guardrails-service_guardrails.DiffType:
      type: string
      enum:
        - added
        - removed
        - changed
        - unchanged
      x-enum-varnames:
        - DiffTypeAdded
        - DiffTypeRemoved
        - DiffTypeChanged
        - DiffTypeUnchanged
    rai-guardrails-service_guardrails.ArtifactChangeKind:
      type: string
      enum:
        - moved
        - type_changed
        - required_changed
        - details_changed
      x-enum-varnames:
        - ChangeKindMoved
        - ChangeKindTypeChanged
        - ChangeKindRequiredChanged
        - ChangeKindDetailsChanged
    rai-guardrails-service_guardrails.ArtifactProperties:
      type: object
      properties:
        alias:
          type: string
        artifactId:
          type: string
        artifactType:
          $ref: '#/components/schemas/rai-guardrails-service_guardrails.ArtifactType'
        detailedType:
          type: string
        details:
          type: object
          additionalProperties: {}
        location:
          $ref: >-
            #/components/schemas/rai-guardrails-service_guardrails.DiffArtifactLocation
        policyEntityId:
          type: string
        required:
          type: boolean
    rai-guardrails-service_guardrails.StageChangeKind:
      type: string
      enum:
        - renamed
        - reordered
      x-enum-varnames:
        - StageChangeKindRenamed
        - StageChangeKindReordered
    rai-guardrails-service_guardrails.StageProperties:
      type: object
      properties:
        name:
          type: string
        policyEntityId:
          type: string
        policyVersionId:
          type: string
        stageId:
          type: string
        stageOrder:
          type: integer
    rai-guardrails-service_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
    rai-guardrails-service_guardrails.ApprovalArtifactProperties:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
        policyEntityId:
          type: string
        required:
          type: boolean
    rai-guardrails-service_guardrails.DiffApprovalLocation:
      type: object
      properties:
        policyVersion:
          type: string
        policyVersionId:
          type: string
        stageId:
          type: string
        stageName:
          type: string
        stagePolicyEntityId:
          type: string
    rai-guardrails-service_guardrails.ArtifactType:
      type: string
      enum:
        - input
        - guidance
        - policyScriptedCheck
        - metadata
      x-enum-varnames:
        - Input
        - Guidance
        - AutomatedJob
        - Metadata
    rai-guardrails-service_guardrails.DiffArtifactLocation:
      type: object
      properties:
        evidenceExternalId:
          type: string
        evidenceId:
          type: string
        evidenceName:
          type: string
        policyVersion:
          type: string
        policyVersionId:
          type: string
        stageApprovalId:
          type: string
        stageApprovalName:
          type: string
        stageApprovalPolicyEntityId:
          type: string
        stageId:
          type: string
        stageName:
          type: string
        stagePolicyEntityId:
          type: string

````

## Related topics

- [Diff policies between two bundles](/api-reference/governance-operations/diff-policies-between-two-bundles.md)
- [Define policies](/cloud/platform-capabilities/features/governance/define-governance-policies/index.md)
- [Replace a bundle's primary policy with a different policy](/api-reference/governance-bundles/replace-a-bundles-primary-policy-with-a-different-policy.md)
- [Domino Cloud release notes](/release-notes/cloud-release.md)
