Skip to content
Dashboard

Compare two versions of a prompt

GET
/campaigns/{id}/prompts/{type}/versions/{versionId}/compare
curl --request GET \
--url https://app.whatsetter.com/api/v1/campaigns/example/prompts/conversation/versions/example/compare \
--header 'Authorization: Bearer <token>'

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.

id
required
string
type
required
string
Allowed values: conversation first_message
versionId
required

A version id from the versions list

string
against
string

The version id to compare with. Default, the text in service.

The comparison

Media typeapplication/json
object
data
object
version

One side of a comparison.

object
id

null for the agent’s own copy, which is in no version.

string | null
version
integer | null
variant
string
Allowed values: A B C D
status
string
Allowed values: live draft inactive
created_at
string | null format: date-time
characters
integer
against

One side of a comparison.

object
id

null for the agent’s own copy, which is in no version.

string | null
version
integer | null
variant
string
Allowed values: A B C D
status
string
Allowed values: live draft inactive
created_at
string | null format: date-time
characters
integer
identical

true when both texts are the same. Line ends and trailing blanks are not differences.

boolean
lines_added

Lines in the version that are not in against.

integer
lines_removed

Lines in against that are not in the version.

integer
diff

Unified diff with two lines of context: + for a line added by the version, - for a line it removed. Empty when identical.

string
Example
{
"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."
}
}

Missing, unknown or revoked API key

Media typeapplication/json
object
error
object
code
string
message
string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

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)

Media typeapplication/json
object
error
object
code
string
message
string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Resource not found in this workspace

Media typeapplication/json
object
error
object
code
string
message
string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

This text keeps no history

Media typeapplication/json
object
error
object
code
string
message
string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

An A/B test runs and the version’s variant is not in it. Name the version to compare with in against.

Media typeapplication/json
object
error
object
code
string
message
string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}