---
title: "Diff two revisions or drafts"
method: GET
path: "/agent/{id}/diff"
tags: ["Agent Versioning - Revisions"]
---

# Diff two revisions or drafts

`GET /agent/{id}/diff`

Compare any two references on this agent and return per-section diffs. Each side (`a` and `b`) is either a `revisionId` or the string `<branchId>:draft` to reference the open draft on a branch. Sides may cross branches. Both references must resolve to configs on the same agent.

## Path parameters

- `id` string, required

## Query parameters

- `a` string, required
- `b` string, required

## Response `200`

Successful response.

- object
  - `status` boolean
  - `data` DiffResult — Returned by `GET /agent/{id}/diff`.
    - `unchangedSections` string[]
    - `diffs` DiffSection[]
      - `section` string
      - `changes` DiffChange[]
        - `path` string — Dot-path to the changed leaf field.
        - `oldValue` unknown
        - `newValue` unknown

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `403` — Forbidden access
- `404` — Resource not found. The referenced ID does not exist or does not belong to the caller's organization.
- `500` — Internal server error

---

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