# Compare two versions of a prompt

`GET https://app.whatsetter.com/api/v1/campaigns/{id}/prompts/{type}/versions/{versionId}/compare`

What a version changes compared to another one, as a line-by-line
diff. With no `against`, the version is compared to the text in
service: what publishing a draft would change, or what the agent
stopped saying since an older version.

In `diff`, a line that starts with `+` is in the version and not in
`against`; a line that starts with `-` is in `against` and not in the
version. Two lines of context surround each change. Line ends and
trailing blanks are not changes. Requires scope `prompts:read`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes |  |
| `type` | path | conversation \| first_message | yes |  |
| `versionId` | path | string | yes |  |
| `against` | query | string | no | The version `id` to compare with. Default, the text in service. |

## Example request

```bash
curl --request GET \
  --url 'https://app.whatsetter.com/api/v1/campaigns/{id}/prompts/{type}/versions/{versionId}/compare' \
  --header 'Authorization: Bearer ws_live_…'
```

## Responses

### 200: The comparison

```json
{
  "data": {
    "version": {
      "id": "68e61f7700093d5b1c02",
      "version": 8,
      "variant": "A",
      "status": "live",
      "created_at": "2026-10-08T14:02:11.000+00:00",
      "characters": 175
    },
    "against": {
      "id": "68e60d3100212c0a9b41",
      "version": 7,
      "variant": "A",
      "status": "inactive",
      "created_at": "2026-10-07T09:18:22.000+00:00",
      "characters": 109
    },
    "identical": false,
    "lines_added": 3,
    "lines_removed": 0,
    "diff": "@@ -4,2 +4,5 @@\n ## Goal\n Qualify the lead, then send {{goal_link}}.\n+\n+## Rules\n+Never give a price before the lead says what they need."
  }
}
```

### 401: Missing, unknown or revoked API key

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 403: The key lacks the required scope (`insufficient_scope`), the plan does not have this part of the API (`not_in_plan`), or Instagram is not enabled on the workspace (`instagram_not_enabled`, Instagram routes)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 404: Resource not found in this workspace

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 409: This text keeps no history

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 422: An A/B test runs and the version's variant is not in it. Name the version to compare with in `against`.

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```


Source: https://docs.whatsetter.com/api-reference/operations/comparepromptversions/
