---
docId: doc_d953a6c7c2604d92ada1c4f852e9c65e
title: Send a campaign
description: "Create a WhatsApp campaign, prepare the audience, confirm the send and read its results."
---

<script>
  import { Note, Steps, Ways } from '$lib/components';
</script>

# Send a campaign

<span id="what-youll-build"></span>

Send an approved template to your WhatsApp contacts and choose the agent that will handle replies. Check recipients, message and cost in the preview before confirming the send. Then read the campaign's results.

## Before you start

You need:

- An [approved WhatsApp template](/guides/whatsapp-templates).
- A [published agent](/guides/create-an-agent) to handle replies. Save its id in `AGENT_ID`.
- The sending number's `prefixedChannelId` in `CHANNEL_ID`. The number must belong to the same WhatsApp account as the template.

To use the platform, see [Campaigns](/help/campaigns).

<Steps>
<Steps.Step>

**Create the campaign**

Give it a title and the template it sends. The title is unique in the workspace. ([Create a campaign](/api-reference/campaigns/create))

<Ways tabs="api,sdk,asistente">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/campaigns \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Spring sale",
    "category": "marketing",
    "templateName": "spring_sale",
    "language": "es_MX"
  }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
import { Platic } from "platic-sdk";

const platic = new Platic({ apiKey: process.env.PLATIC_API_KEY! });

const campaign = await platic.campaigns.create({
  title: "Spring sale",
  category: "marketing",
  templateName: "spring_sale",
  language: "es_MX",
});
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Create a marketing campaign called Spring sale with the spring_sale template in Spanish (Mexico).

</Ways.Say>

Tool: [`create_campaign`](/mcp/tools#create_campaign).

</Ways.Way>
</Ways>

Save the campaign's `id` in `CAMPAIGN_ID`.

`category` accepts `marketing` or `utility`. Use `language` to choose the template's language; the response shows the saved language. A missing template returns `TEMPLATE_NOT_FOUND`. A template that isn't approved returns `TEMPLATE_NOT_APPROVED`.

If the template's button leads to your site, set where it goes with [Update a campaign](/api-reference/campaigns/update) (`ctaTargetUrl`). Every recipient gets their own link, and the click and the purchase are measured.

</Steps.Step>
<Steps.Step>

**Build the audience**

Add contacts (`clients` in the API) by phone number, or all at once from a [contact search](/api-reference/contacts/search), a tag or a list of ids. Contacts that don't exist in the workspace are created. ([Add audience](/api-reference/campaigns/audience/add))

<Ways tabs="api,sdk,asistente">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/audience \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "clients": [
      { "phoneNumber": "5215512345678", "name": "Ana" },
      { "phoneNumber": "5215587654321", "name": "Luis" }
    ]
  }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
const campaignId = campaign.id;

await platic.campaigns.audience.add(campaignId, [
  { phoneNumber: "5215512345678", name: "Ana" },
  { phoneNumber: "5215587654321", name: "Luis" },
]);
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Add to the Spring sale campaign every contact with the tag customers.

</Ways.Say>

Tool: [`add_campaign_audience`](/mcp/tools#add_campaign_audience). To find contacts first it uses [`search_clients`](/mcp/tools#search_clients).

</Ways.Way>
</Ways>

Send exactly one source: `clients`, `searchId`, `tag` or `clientIds` (up to 5,000). With `dryRun: true` it only says how many would join, without changing the audience. To see or remove people, use [Get the audience](/api-reference/campaigns/audience/get), [Remove from the audience](/api-reference/campaigns/audience/remove) and [Clear the audience](/api-reference/campaigns/audience/clear).

</Steps.Step>
<Steps.Step>

**Define a goal**

Define the result you want to measure, such as "Asked for a quote". The report counts campaign conversations that meet that criterion. ([Goals](/api-reference/campaigns/goals))

<Ways tabs="api,sdk,asistente">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/goals \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Asked for a quote", "criteria": "The customer asks about a price or asks for a quote." }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
const goal = await platic.campaigns.goals.create(campaignId, {
  name: "Asked for a quote",
  criteria: "The customer asks about a price or asks for a quote.",
});
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

In the Spring sale campaign, count it as achieved when the customer asks for a price or a quote.

</Ways.Say>

Tool: [`create_campaign_goal`](/mcp/tools#create_campaign_goal).

</Ways.Way>
</Ways>

If the campaign already has a goal with that name, no other is created: the response is `200` with that goal and `alreadyExisted: true`. To change its criteria, update it with [Goals](/api-reference/campaigns/goals).

</Steps.Step>
<Steps.Step>

**Preview the send**

Generate a preview first. Without sending messages, it shows the recipients, sending number, message with real data, cost and who will respond.

Set who handles replies (`replyHandling`), the sending number (`senderChannelId`) and the template's values (`variables`). ([Send a campaign](/api-reference/campaigns/send))

<Ways tabs="api,sdk,asistente">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/send/preview \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "replyHandling": "agent",
    "responderAgentId": "'"$AGENT_ID"'",
    "senderChannelId": "'"$CHANNEL_ID"'",
    "variables": ["client_firstname"]
  }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
const decisions = {
  replyHandling: "agent",
  responderAgentId: process.env.AGENT_ID!,
  senderChannelId: process.env.CHANNEL_ID!,
  variables: ["client_firstname"],
} as const;

const preview = await platic.campaigns.previewSend(campaignId, decisions);
console.log(preview.resumen, preview.avisos);
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Prepare the send of the Spring sale campaign from my WhatsApp number. Have the Sales agent answer and use each contact's name in the message.

</Ways.Say>

Tool: [`preview_campaign_send`](/mcp/tools#preview_campaign_send) and shows you the result before sending.

</Ways.Way>
</Ways>

Check `resumen`, `mensaje`, `variables_sin_resolver` and `avisos`. `mensaje` shows the variables filled with real contact data. The preview sends no messages and doesn't change the campaign.

Blocked contacts and contacts who unsubscribed from marketing are excluded. Each date in `scheduledDates` repeats the full send to the same audience and incurs another charge.

</Steps.Step>
<Steps.Step>

**Confirm the send**

Send the `confirmation` from the preview with **the same decisions**. It is valid for 30 minutes and works for one send. ([Send a campaign](/api-reference/campaigns/send))

<Ways tabs="api,sdk,asistente">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/send \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "confirmation": "'"$CONFIRMATION"'",
    "replyHandling": "agent",
    "responderAgentId": "'"$AGENT_ID"'",
    "senderChannelId": "'"$CHANNEL_ID"'",
    "variables": ["client_firstname"]
  }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
if (preview.confirmation) {
  const sent = await platic.campaigns.send(campaignId, { ...decisions, confirmation: preview.confirmation });
  console.log(sent.runId);
}
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Yes, send it.

</Ways.Say>

Tool: [`send_campaign`](/mcp/tools#send_campaign) with the `confirmation` from the preview.

</Ways.Way>
</Ways>

Save the response's `runId`. It confirms that the send is queued; messages go out afterwards. Use the funnel in the next step to check progress without repeating the send call.

If something changed since the preview (the audience, the template or the link's destination), nothing is sent and the response is `409` with what changed: ask for another preview. A `confirmation` that was already used also answers `409`.

<Note type="important">

From the API, fewer than 5,000 messages go out per campaign every 24 hours, counting sends and scheduled dates. If the preview goes over that, it arrives with `requiere_autorizacion: true` and no `confirmation`: a person launches that send from the campaign's board.

</Note>

</Steps.Step>
<Steps.Step>

**Read the results**

The funnel counts distinct people at every step of each send (sent, delivered, read, clicks and purchases). The report covers a period: conversations, messages per day and how many met each goal. ([Results](/api-reference/campaigns/results))

<Ways tabs="api,sdk,asistente">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/funnel \
  -H "Authorization: Bearer $PLATIC_API_KEY"

curl "https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/report?startDate=2026-11-01&endDate=2026-11-30" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
const funnel = await platic.campaigns.funnel(campaignId);
for (const run of funnel.data.runs) console.log(run.runId, run.funnel, run.rates);

const report = await platic.campaigns.report(campaignId, { startDate: "2026-11-01", endDate: "2026-11-30" });
console.log(report.metrics, report.goals);
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

How is the Spring sale campaign doing?

</Ways.Say>

Tool: [`get_campaign_funnel`](/mcp/tools#get_campaign_funnel) and [`get_campaign_report`](/mcp/tools#get_campaign_report).

</Ways.Way>
</Ways>

Each metric requires its event: a click without a read receipt does not count as read. Amounts are in **cents**. If you omit dates, the report covers the current month in Mexico City time. Use [Export recipients](/api-reference/campaigns/results) to download the recipients of a send as CSV.

</Steps.Step>
</Steps>

## Check it worked

Find your `runId` in the funnel and check that the sent count increases. When a contact replies, check the inbox to confirm that the conversation is assigned to the agent you chose.

## Next steps

- [Hand a conversation to your team](/guides/human-handoff) when a contact needs a person.
- [Receive webhooks](/guides/webhooks) to follow replies and message events in your own system.
- [Campaigns](/api-reference/campaigns): every endpoint, with its limits.
