# Get an agent's prompts

`GET https://app.whatsetter.com/api/v1/campaigns/{id}/prompts`

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

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes |  |
| `rendered` | query | boolean | no | Also return `rendered_body` on each live variant. |

## Example request

```bash
curl --request GET \
  --url 'https://app.whatsetter.com/api/v1/campaigns/{id}/prompts' \
  --header 'Authorization: Bearer ws_live_…'
```

## Responses

### 200: The agent's prompts

```json
{
  "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"
  }
}
```

### 401: Missing, unknown or revoked API key

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 403: 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)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 404: Resource not found in this workspace

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```


Source: https://docs.whatsetter.com/api-reference/operations/getcampaignprompts/
