# Diff an agent version (/docs/api-reference/agents/diffAgentVersion)

> Get a record-level diff for this version. By default it shows what changed in this version compared with the version before it. Use `against=current` to compare with the agent's live config (what restoring this version would change), or `against=<number>` to compare with another version.

**GET** `/agents/{agent_id}/versions/{version_number}/diff`

Get a record-level diff for this version. By default it shows what changed in this version compared with the version before it. Use `against=current` to compare with the agent's live config (what restoring this version would change), or `against=<number>` to compare with another version.

```yaml
operationId: diffAgentVersion
parameters:
  - name: against
    in: query
    schema:
      type: string
    description: >-
      What to compare against. Omit or `previous` for the version before this one (the default).
      `current` for the agent's live config. A version number to compare with that version.
responses:
  '200':
    description: Diff between the two versions.
    content:
      application/json:
        schema:
          type: object
          properties:
            changed:
              type: boolean
              description: Whether there is any difference between the two sides.
            first:
              type: boolean
              description: >-
                True when this is the earliest version and there is nothing before it to compare
                (only for the default previous-version comparison).
            from:
              type: object
              nullable: true
              description: The version being compared from, or null when `first` is true.
              properties:
                version_number:
                  type: integer
                name:
                  type: string
            to:
              description: >-
                The comparison target: an object with the version number and name for a version, or
                a text label such as `current setup`.
              oneOf:
                - type: object
                  properties:
                    version_number:
                      type: integer
                    name:
                      type: string
                - type: string
            groups:
              type: array
              items:
                type: object
                properties:
                  area:
                    type: string
                    description: >-
                      Section of the agent this group of changes belongs to (e.g. Settings, Prompt,
                      Transfer rules, Post-call actions, Knowledge, Integrations, Web widget,
                      Conversation flow, Other settings).
                  changes:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        label:
                          type: string
                        old:
                          type: string
                        new:
                          type: string
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        op:
                          type: string
                          enum:
                            - added
                            - removed
                            - edited
                        label:
                          type: string
        example:
          changed: true
          first: false
          from:
            version_number: 4
            name: Before pricing tweak
          to:
            version_number: 5
            name: Working pricing script
          groups:
            - area: Settings
              changes:
                - field: llm_service
                  label: Model
                  old: gpt-4.1-mini
                  new: gpt-4o-mini
            - area: Knowledge
              records:
                - op: added
                  label: pricing-sheet.pdf
  '403':
    description: Version history is not enabled for this organization.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
            error_description:
              type: string
        example:
          error: feature_disabled
          error_description: Version history is not enabled for this organization
  '404':
    description: No agent or version matching that ID.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
            error_description:
              type: string
        example:
          error: not_found
          error_description: Version not found for this agent
```

**Python SDK**

```python
from omnidimension import Client
client = Client(api_key)

# What changed in this version (vs the previous one)
agent_id = "your_agent_id_here"
version_number = 5
response = client.agent.diff_version(agent_id, version_number)
print(response)
```

**curl**

```bash
curl -X GET "https://omnidim.io/api/v1/agents/{agent_id}/versions/{version_number}/diff" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```