> For the complete documentation index, see [llms.txt](https://playbook.nativemsg.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playbook.nativemsg.com/mcp/guides/run-a-campaign.md).

# Run a Campaign with Your Agent

The full outbound loop, in plain language, with the guardrails where they belong.

## 1. Define the audience

> "Tag everyone who tapped Reorder this week as repeat-buyer."

Segment with tags (`list_humans_by_tag`, `assign_tags_to_human`) or attributes (`find_humans_by_attributes`). Create a tag when the segment will be reused. Only contacts who **opted in** and are **subscribed** to a channel can be reached — your agent should never re-add someone who opted out, no matter how the request is phrased.

## 2. Prepare the content

Use a saved template (`create_message_template`) for anything you'll send more than once. Include your brand name and STOP/HELP where required. For rich content, set a `fallback_message` so SMS-only recipients still get the message.

## 3. Create and target the blast

> "Create a blast called 'Friday thank-you offer' with the repeat-buyer tag on our RCS channel."

`create_blast` → `assign_blast_tags` → `assign_blast_channels`. Note: tag/channel assignment **replaces the whole set** each call.

## 4. Count — always — then test

> "How many people will this reach?"

`get_blast_recipients_count` before anything sends. Expect your agent to state the number and ask you to confirm; that's by design. Then send to a tester device and check it on a real phone.

## 5. Schedule, don't fire

> "Schedule it for Friday at 10am."

`schedule_blast` beats an immediate `send_blast` for any sizable audience: the gap until it fires is your cancel window (`cancel_blast_schedule`). Schedule inside recipients' business hours. A sent blast cannot be recalled.

## 6. Track

`send_blast`/the fired schedule returns a `requestId` — `get_message_status` breaks delivery down per recipient (delivered, failed, read). While a blast is `processing`, `get_blast_recipients_count` returns per-status counts.

## Changing or stopping

* Edit only **drafts** (`update_blast`); cancel a schedule first to edit a scheduled blast.
* `delete_blast` on a scheduled or sending blast requires an explicit force — forcing a sending blast stops the remaining sends.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://playbook.nativemsg.com/mcp/guides/run-a-campaign.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
