Prompts
Get one prompt
const url = 'https://app.whatsetter.com/api/v1/campaigns/example/prompts/conversation?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/conversation?rendered=false' \ --header 'Authorization: Bearer <token>'One text of the agent: what is live, and for a versioned prompt its
unpublished drafts. Same shape as one entry of
GET /campaigns/{id}/prompts. Requires scope prompts:read.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A text the agent runs on. A private-message agent has conversation
(how it replies), first_message and the four follow-ups: cold goes
to a lead who never replied, abandoned to a lead who stopped
replying, _1 then _2. A group agent has group_reply (in the
group) and group_dm (in private).
Query Parameters
Section titled “Query Parameters”Also return rendered_body on each live variant (versioned prompts).
Responses
Section titled “Responses”The prompt
object
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.
Example
{ "data": { "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 }}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 agent has no text of that type
object
object
Example
{ "error": { "code": "invalid_state", "message": "A private-message agent has no \"group_reply\" text. Its texts: conversation, first_message, follow_up_cold_1, follow_up_cold_2, follow_up_abandoned_1, follow_up_abandoned_2." }}