Prompts
Compare two versions of a prompt
const url = 'https://app.whatsetter.com/api/v1/campaigns/example/prompts/conversation/versions/example/compare';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A version id from the versions list
Query Parameters
Section titled “Query Parameters”The version id to compare with. Default, the text in service.
Responses
Section titled “Responses”The comparison
object
object
One side of a comparison.
object
null for the agent’s own copy, which is in no version.
One side of a comparison.
object
null for the agent’s own copy, which is in no version.
true when both texts are the same. Line ends and trailing blanks are not differences.
Lines in the version that are not in against.
Lines in against that are not in the version.
Unified diff with two lines of context: + for a line added by the version, - for a line it removed. Empty when identical.
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
object
object
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)
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Resource not found in this workspace
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}This text keeps no history
object
object
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.
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}