Skip to content
Dashboard

Get an agent's prompts

GET
/campaigns/{id}/prompts
curl --request GET \
--url 'https://app.whatsetter.com/api/v1/campaigns/example/prompts?rendered=false' \
--header 'Authorization: Bearer <token>'

Everything the agent runs on, in one call: the conversation prompt (how it replies), the first_message prompt and the four follow-ups; for a group agent, group_reply and group_dm instead.

A versioned prompt lists what is live right now: what the agent reads, by the engine’s own rule. A draft saved in the editor is not live. It is listed apart, in unpublished_drafts, for as long as it is the newest text of its variant and differs from what the agent reads.

The live text is a numbered version. The one exception is a text that is in no version (an agent older than versions, or a text rewritten outside the editor): it is then live on its own, with version: null, and the first change made through the API files it in the history.

variables gives the value behind each {{token}} of the texts. {{first_name}} and {{lead:<column>}} are not in it: they change with each lead. Pass rendered=true to also get each live text with its variables resolved and the agent’s style inlined.

{id} accepts the campaign id or its campaign_id. Requires scope prompts:read.

id
required

The campaign id or campaign_id from GET /campaigns

string
rendered
boolean

Also return rendered_body on each live variant.

The agent’s prompts

Media typeapplication/json
object
data
object
campaign
object
id
string
campaign_id

The value used by /leads?campaign_id= and lead objects.

string | null
name
string | null
agent_name

The first name the agent signs with (what people call it).

string | null
status

unknown for an internal value outside this list.

string | null
Allowed values: active draft paused archived unknown
purpose

setter = 1:1 conversations; group = a WhatsApp group campaign (its participants are left out of /leads unless filtered). unknown for an internal value outside this list.

string | null
Allowed values: setter group unknown
channels

Where the agent talks: WhatsApp, Instagram (an account answers with it), Messenger (facebook: a Facebook Page answers with it).

Array<string>
Allowed values: whatsapp instagram facebook
whatsapp_connected

Whether its WhatsApp number can send right now (false for an agent that only talks on Instagram or Messenger).

boolean
knowledge_base_id

The knowledge base this agent answers from (GET /knowledge-bases/{id}).

string | null
created_at
string format: date-time
prompts

One entry per text the agent has, in a fixed order.

Array
One of:

The conversation or first_message prompt.

object
type
string
Allowed values: conversation first_message
versioned
boolean
ab_test

true while two variants or more share the traffic.

boolean
live

What the agent runs on now. One entry, or one per variant while an A/B test runs.

Array<object>
object
variant
string
Allowed values: A B C D
name

The name a person gave the variant in the dashboard, if any.

string | null
version

null when the text in service is in no version: the agent’s own copy, kept outside the history.

integer | null
version_id
string | null
traffic_share

Share of new conversations this variant gets (1 when it is alone).

number
created_at
string | null format: date-time
body

The text, with its {{tokens}}.

string
rendered_body

Only with rendered=true. The text with variables resolved and the agent’s style inlined.

string
characters
integer
unpublished_drafts

Saved in the editor and never published. Each one is the newest text of its variant and differs from what the agent reads. A write on that variant is refused until the draft is published or ignore_draft is sent.

Array<object>
object
variant
string
Allowed values: A B C D
version
integer
version_id
string
created_at
string | null format: date-time
max_characters
integer
variables

The value behind each {{token}} of the texts, the workspace’s own variables included. Per-lead tokens ({{first_name}}, {{lead:<column>}}) are not listed.

object
key
additional properties
string
knowledge_base_id

The base the agent answers from (GET /knowledge-bases/{id}), if it has one.

string | null
Example
{
"data": {
"campaign": {
"id": "68c1f0a2003b6f1d2e77",
"campaign_id": "salle-horizon-k3fa",
"name": "Salle Horizon",
"agent_name": "Julien",
"status": "active",
"purpose": "setter",
"whatsapp_connected": true,
"knowledge_base_id": "68c1f1c4001a09be5d10",
"created_at": "2026-09-02T09:14:51.000+00:00"
},
"prompts": [
{
"type": "conversation",
"versioned": true,
"ab_test": false,
"live": [
{
"variant": "A",
"name": null,
"version": 7,
"version_id": "68e60d3100212c0a9b41",
"traffic_share": 1,
"created_at": "2026-10-07T09:18:22.000+00:00",
"body": "## Identity\nYou are {{agent_name}} from {{company_name}}.\n\n## Goal\nQualify the lead, then send {{goal_link}}.",
"characters": 109
}
],
"unpublished_drafts": [],
"max_characters": 40000
},
{
"type": "first_message",
"versioned": true,
"ab_test": false,
"live": [
{
"variant": "A",
"name": null,
"version": 3,
"version_id": "68e60d3100212c0a9b42",
"traffic_share": 1,
"created_at": "2026-10-07T09:18:22.000+00:00",
"body": "Greet {{first_name}} and ask what brought them here.",
"characters": 52
}
],
"unpublished_drafts": [],
"max_characters": 25000
},
{
"type": "follow_up_cold_1",
"versioned": false,
"body": "Write a short follow-up to {{prospectName}} who has not replied yet.",
"uses_default": false,
"characters": 68,
"max_characters": 15000,
"enabled": true,
"delay_hours": 24
}
],
"variables": {
"agent_name": "Julien",
"company_name": "Salle Horizon",
"owner_first_name": "Marc",
"goal_link": "https://cal.com/salle-horizon/essai",
"offer_description": "Gym memberships from 39 EUR per month",
"value_proposition": "Train close to home, coached, no commitment",
"business_focus": "",
"language": "English",
"top_pain": "cannot keep a routine alone",
"goal_action_noun": "the link"
},
"knowledge_base_id": "68c1f1c4001a09be5d10"
}
}

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"
}
}