Prompts
Get an agent's prompts
const url = 'https://app.whatsetter.com/api/v1/campaigns/example/prompts?rendered=false';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?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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The campaign id or campaign_id from GET /campaigns
Query Parameters
Section titled “Query Parameters”Also return rendered_body on each live variant.
Responses
Section titled “Responses”The agent’s prompts
object
object
object
The value used by /leads?campaign_id= and lead objects.
The first name the agent signs with (what people call it).
unknown for an internal value outside this list.
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.
Where the agent talks: WhatsApp, Instagram (an account answers with it), Messenger (facebook: a Facebook Page answers with it).
Whether its WhatsApp number can send right now (false for an agent that only talks on Instagram or Messenger).
The knowledge base this agent answers from (GET /knowledge-bases/{id}).
One entry per text the agent has, in a fixed order.
The conversation or first_message prompt.
object
true while two variants or more share the traffic.
What the agent runs on now. One entry, or one per variant while an A/B test runs.
object
The name a person gave the variant in the dashboard, if any.
null when the text in service is in no version: the agent’s own copy, kept outside the history.
Share of new conversations this variant gets (1 when it is alone).
The text, with its {{tokens}}.
Only with rendered=true. The text with variables resolved and the agent’s style inlined.
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.
object
A follow-up or a group text. One text, no versions.
object
null when the agent has no text of its own and uses the built-in one.
Follow-ups only. Whether this follow-up is sent.
Follow-ups only. Hours of silence before it is sent.
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
The base the agent answers from (GET /knowledge-bases/{id}), if it has one.
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
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" }}