Skip to content
Dashboard

Get one prompt

GET
/campaigns/{id}/prompts/{type}
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.

id
required
string
type
required

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).

string
Allowed values: conversation first_message follow_up_cold_1 follow_up_cold_2 follow_up_abandoned_1 follow_up_abandoned_2 group_reply group_dm
rendered
boolean

Also return rendered_body on each live variant (versioned prompts).

The prompt

Media typeapplication/json
object
data
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
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

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 agent has no text of that type

Media typeapplication/json
object
error
object
code
string
message
string
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."
}
}