---
docId: doc_0ff7f35a3d1b42308cfb3930939159f6
title: Compare versions
description: "Shows changed configuration sections between two agent versions."
api:
  group: agentes/versiones
  auth: bearer
  operations:
    - operationId: compareVersions
      method: GET
      path: '/v1/agents/{agentId}/versions/{versionId}/compare'
      postmanName: Compare versions
      query:
        - key: with
          value: v1
          description: La otra versión.
---

<script>
  import { Ways } from '$lib/components';
</script>

# Compare versions

Review what would change before publishing. Send one version in `versionId` and the other in `with`; the response shows each changed section with its previous and new contents.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl "https://api.platic.ai/v1/agents/$AGENT_ID/versions/v3/compare?with=v5" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.versions.compare("agent_123", "v3", "v5");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |
| `versionId` | string | One version, for example `v3`. It is the "before" of the comparison | ✓ |

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `with` | string | The other version, for example `v5`. It is the "after" | ✓ |

## Response

```json
{
  "status": "success",
  "data": {
    "from": "v3",
    "to": "v5",
    "sections": [
      {
        "section": "instructions",
        "before": "You are the sales assistant for Acme Store.",
        "after": "You are the sales assistant for Acme Store. Answer in under 80 words."
      },
      {
        "section": "followUp",
        "before": {
          "enabled": false,
          "delayMinutes": 60,
          "maxConsecutiveMessages": 1,
          "messageType": "automatic",
          "customMessage": "",
          "customInstructions": ""
        },
        "after": {
          "enabled": true,
          "delayMinutes": 30,
          "maxConsecutiveMessages": 1,
          "messageType": "automatic",
          "customMessage": "",
          "customInstructions": ""
        }
      }
    ]
  }
}
```

| Field | Description |
|-------|-------------|
| `from` | The version in the path |
| `to` | The version in `with` |
| `sections` | One entry per section that differs. Empty if the two versions are the same |
| `sections[].section` | Name of the [section](/api-reference/agents/configuration#sections) |
| `sections[].before` | The complete section in `from`, in its shape: a text (`instructions`, `model`), a boolean (`memory`), an object (`guardrails`) or a list (`subagents`) |
| `sections[].after` | The complete section in `to`, with the same shape |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | `with` is missing |
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist in the workspace or was deleted |
| `404` | `VERSION_NOT_FOUND` | One of the two versions doesn't exist on that agent |

## Notes

- To see what would change on publishing, compare the published version with the draft's: both are in [Get an agent](/api-reference/agents/get).
- This comparison is of configuration. To compare how two versions answer with simulated conversations, see [Evals](/api-reference/evals).
