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

# Diff two versions structurally

> Compare two versions at the JDM structure level.

Reports nodes added, removed, renamed and modified; decision-table
rows added, removed, reordered and changed cell by cell; expression
and schema changes; and edge changes. This is what makes the
approval gate meaningful — a text diff of the raw JSON is not
reviewable.

**Required roles**: any membership in the workspace



## OpenAPI

````yaml get /api/decisions/{workspace}/{key}/diff
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/decisions/{workspace}/{key}/diff:
    get:
      tags:
        - Decisions
      summary: Diff two versions structurally
      description: |-
        Compare two versions at the JDM structure level.

        Reports nodes added, removed, renamed and modified; decision-table
        rows added, removed, reordered and changed cell by cell; expression
        and schema changes; and edge changes. This is what makes the
        approval gate meaningful — a text diff of the raw JSON is not
        reviewable.

        **Required roles**: any membership in the workspace
      operationId: diff_versions_api_decisions__workspace___key__diff_get
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            maxLength: 64
            pattern: ^[a-z0-9][a-z0-9-]{0,63}$
            description: Workspace slug.
            title: Workspace
          description: Workspace slug.
        - name: key
          in: path
          required: true
          schema:
            type: string
            maxLength: 64
            pattern: ^[a-z0-9][a-z0-9-]{0,63}$
            description: Decision key — a flat slug, never a path.
            title: Key
          description: Decision key — a flat slug, never a path.
        - name: from
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
            title: From
        - name: to
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiffResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    DiffResponse:
      properties:
        workspace:
          type: string
          title: Workspace
        key:
          type: string
          title: Key
        from_version:
          type: integer
          title: From Version
        to_version:
          type: integer
          title: To Version
        identical:
          type: boolean
          title: Identical
        summary:
          additionalProperties: true
          type: object
          title: Summary
        nodes:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Nodes
        edges:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Edges
      type: object
      required:
        - workspace
        - key
        - from_version
        - to_version
        - identical
        - summary
        - nodes
        - edges
      title: DiffResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````