---
title: "Diff two versions"
method: GET
path: "/agent/{id}/versions/diff"
tags: ["Agent Versioning - Versions"]
---

# Diff two versions

`GET /agent/{id}/versions/diff`

Compare two version or draft revision records side-by-side by their IDs. The implementation tries published versions first and can fall back to the latest draft revision.

## Path parameters

- `id` string, required

## Query parameters

- `versionA` string, required
- `versionB` string, required

## Response `200`

Diff returned successfully

- object
  - `status` boolean
  - `data` AgentVersionDiff — Section-by-section diff between two version or draft revision records.
    - `unchangedSections` string[] — Config sections that did not change.
    - `diffs` object[] — Config sections with one or more changes.
      - `section` string — Config section name.
      - `changes` object[]
        - `path` string — Path to the changed value within the section.
        - `oldValue` union — Previous value. Can be any JSON value or null.
          - string
          - number
          - boolean
          - object
          - unknown[]
            - unknown
        - `newValue` union — New value. Can be any JSON value or null.
          - string
          - number
          - boolean
          - object
          - unknown[]
            - unknown

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `403` — Forbidden. Returned for workflow_graph agents when the organization lacks conversational agents access.
- `404` — Agent or version not found
- `500` — Internal server error

## Changes

- **2026-05-26** `5a6b4e19f353` — 4 info
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
  - added the optional property `data/diffs` to the response with the `200` status
  - added the optional property `data/unchangedSections` to the response with the `200` status
- **2026-04-20** `801f1d220d57` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/smallest-inc/apis/agent-management-api/changes/agent/:id/versions/diff/get.md)

---

[API](https://skmtc.dev/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.dev/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/ea4ea58d7c4e/schema)
