---
docId: doc_7cc5a8a19f3643f884cc3fa154f024ef
title: Send a campaign
description: "Preview a campaign and confirm the send."
api:
  group: campañas
  auth: bearer
  operations:
    - operationId: previewCampaignSend
      method: POST
      path: '/v1/campaigns/{campaignId}/send/preview'
      postmanName: Preview a send
    - operationId: sendCampaign
      method: POST
      path: '/v1/campaigns/{campaignId}/send'
      postmanName: Send a campaign
---

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

# Send a campaign

First request a **preview**. It shows the recipients, sender number, message with real data, cost, and who will answer replies. It does not send messages.

Then **confirm** with the preview's `confirmation` to send exactly what you reviewed.

**Before you start:** prepare the audience and an approved template. Save the `id` in `CAMPAIGN_ID`. Configure the template, buttons, and link destination with [update a campaign](/api-reference/campaigns/update) before sending.

## 1. See what would go out

Decide three things: who answers the replies (`replyHandling`), which number it goes out from (`senderChannelId`), and what fills the template variables (`variables`).

<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": "wb-123456789",
    "variables": ["client_firstname"]
  }'
```

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

```ts
const campaignId = process.env.CAMPAIGN_ID!;
const decisions = {
  replyHandling: "agent",
  responderAgentId: process.env.AGENT_ID!,
  senderChannelId: "wb-123456789",
  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>

Get the Spring sale campaign ready to send from the store's WhatsApp. Have the Sales agent answer the replies and use each contact's name in the message.

</Ways.Say>

Your assistant uses `preview_campaign_send` and shows you the result before sending.

</Ways.Way>
</Ways>

Review `resumen` (summary), `mensaje` (with real contact data), `variables_sin_resolver` (unresolved variables), and `avisos` (warnings). The campaign stays unchanged until you confirm the send.

## 2. Confirm the send

Send the `confirmation` with **the same decisions** as the preview. It is valid for 30 minutes and works for a single 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": "wb-123456789",
    "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>

Your assistant uses `send_campaign` with the `confirmation` from the preview.

</Ways.Way>
</Ways>

The response includes a `runId` as soon as the send is queued. Messages are sent afterwards. Check progress in the [funnel](/api-reference/campaigns/results#funnel) instead of requesting another send.

If the audience, template, or link destination changed after the preview, the API returns `409` without sending messages and identifies the change. Request another preview. A used `confirmation` also returns `409`.

<Note type="note">

From the API, fewer than 5,000 messages per campaign go out every 24 hours, counting sends and scheduled dates. If the preview goes over that, it arrives with `requiere_autorizacion: true` and without `confirmation`: that send is launched by a person from the campaign dashboard.

</Note>

## Preview reference

| Parameter | In | Type | Description | Required |
|-----------|----|------|-------------|----------|
| `campaignId` | path | string | The campaign `id` | ✓ |
| `workspace` | query | string | The campaign's workspace, if the credential covers several | — |

### Request body

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `replyHandling` | string | `agent`: an agent answers the replies. `none`: nobody answers them and they stay in the inbox | ✓ |
| `responderAgentId` | string | The agent that answers. Required with `replyHandling: "agent"`; it does not need to be assigned to the channel | — |
| `senderChannelId` | string | The channel that sends, with its prefix (`wb-…`), from the same WhatsApp account as the template. If it is not, the error says which ones work | ✓ |
| `variables` | string[] | The value of each `{{n}}` in the body, in order: a contact field (`client_firstname`, `client_name`…), a custom field, or a fixed text. Empty if the template has no variables | — |
| `sendToProblematic` | boolean | Includes the contacts that Meta is limiting by volume. Almost always `false`: those sends tend to fail. Default `false` | — |
| `scheduledDates` | string[] | Future moments in ISO 8601 with a time zone, such as `2026-12-01T18:00:00Z`. **Each date is another complete send** to the same audience and costs again. Empty to send now | — |

Blocked contacts and contacts who unsubscribed from marketing are always left out.

### Response

```json
{
  "status": "success",
  "message": "1,250 destinatarios · $1,087.50 MXN + IVA ($1,261.50 MXN con IVA) · envío inmediato",
  "data": {
    "confirmation": "eyJ2IjoxLCJmIjoi…",
    "requiere_autorizacion": false,
    "resumen": "1,250 destinatarios · $1,087.50 MXN + IVA ($1,261.50 MXN con IVA) · envío inmediato",
    "destinatarios": {
      "reciben": 1250,
      "activos": 1240,
      "con_restricciones_meta": 10,
      "excluidos": 12,
      "bloqueados": 3,
      "numero_no_entregable": 4,
      "baja_de_marketing": 5,
      "nota_bajas": "5 contactos respondieron STOP o se dieron de baja del marketing. …"
    },
    "canal": { "channelId": "wb-123456789", "numero": "+52 55 1234 5678", "nombre": "Acme Store", "wabaId": "1029384756", "tier": "TIER_10K" },
    "plantilla": { "nombre": "spring_sale", "idioma": "en_US", "categoria": "MARKETING", "estado": "APPROVED" },
    "respuestas": "Contesta el agente Sales.",
    "enlace_medido": { "destino": "https://example.com/spring", "nota": "Cada destinatario recibe su propio enlace firmado; el click y la compra se miden." },
    "mensaje": ["Hi Ana, the spring sale has started…", "Hi Luis, the spring sale has started…"],
    "variables_sin_resolver": [],
    "costo_estimado_antes_de_iva_mxn": 1087.5,
    "costo_estimado_mxn": 1261.5,
    "envios_programados": 1,
    "mensajes_en_total": 1250,
    "avisos": [],
    "siguiente_paso": "Enseña esto al usuario —a cuántos va, el mensaje, el costo— y espera su OK explícito. …"
  }
}
```

The response is written in Spanish for the person who approves the send; the field names below keep that language.

| Field | Description |
|-------|-------------|
| `confirmation` | The only thing that authorizes the send. It is valid for 30 minutes and a single send. It does not arrive with `requiere_autorizacion: true` |
| `requiere_autorizacion` | `true` if the send goes over 5,000 messages in 24 hours; `autorizacion` explains why |
| `destinatarios` | How many receive it and how many are left out, and why |
| `canal`, `plantilla` | Where it goes out from and which template, with its status in Meta |
| `respuestas` | Who answers, in words |
| `enlace_medido` | The button destination, if the campaign has one; `null` if not |
| `mensaje` | The message text with the variables resolved on some real contacts |
| `variables_sin_resolver` | The variables that ended up empty in those examples |
| `costo_estimado_antes_de_iva_mxn`, `costo_estimado_mxn` | The estimated cost, before and after VAT |
| `envios_programados`, `mensajes_en_total` | How many complete sends and how many messages in total |
| `avisos` | Texts with what is worth saying before sending |

## Send reference

It takes the same path and query parameters as the preview.

### Request body

The `confirmation` and the same fields as the preview, with the same values:

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `confirmation` | string | The `confirmation` from the preview | ✓ |
| `replyHandling`, `responderAgentId`, `senderChannelId`, `variables`, `sendToProblematic`, `scheduledDates` | | As in the preview | |

### Response

```json
{
  "status": "success",
  "message": "Campaign send queued",
  "data": {
    "estado": "encolado",
    "runId": "run_8fK2pQx7",
    "programado": null,
    "destinatarios": 1250,
    "canal": "wb-123456789",
    "plantilla": "spring_sale",
    "respuestas": "el agente Sales",
    "destino_medido": "https://example.com/spring",
    "siguiente_paso": "Dile al usuario que el envío arrancó y con cuántos destinatarios. …"
  }
}
```

| Field | Description |
|-------|-------------|
| `estado` | `encolado` (goes out now) or `programado` (with `scheduledDates`); in the second case `message` is `Campaign scheduled` |
| `runId` | The send run; with several dates, the first one, and `runIds` carries all of them |
| `programado` | The scheduled dates, or `null` |
| `destinatarios` | How many each send goes to; with several dates, `envios` and `destinatarios_totales` |
| `canal`, `plantilla`, `respuestas`, `destino_medido` | What was sent |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | `confirmation` is missing when sending, `responderAgentId` is missing with `replyHandling: "agent"`, the channel is not from the template's WhatsApp account, the template is not approved, or the credential covers several workspaces and `workspace` is missing. The body says what to fix |
| `403` | `FORBIDDEN` | The send goes over 5,000 messages in 24 hours (`details.motivo: "requiere_autorizacion"`, with `destinatarios`, `mensajes`, `ya_en_ventana`, and `umbral`): a person launches it from the dashboard |
| `404` | `NOT_FOUND` | There is no campaign with that `id` |
| `409` | `CONFLICT` | Something changed since the preview or the `confirmation` is not usable (`details.motivo`: `stale`, `expired`, `missing`, `malformed`, or `tampered`; with `stale`, `details.cambio` says what changed: `alcance`, `audiencia`, `mensaje`, `canal`, or `programacion`), the `confirmation` was already used (`details.runId`), or another send of the campaign is in progress. Ask for another preview |
| `502` | `UPSTREAM_ERROR` | Platica could not queue the send. If `details.ejecuciones_creadas` is `0`, nothing went out and you can retry with the same `confirmation`. If part of it went out, `details.parcial` is `true`, `details.ejecuciones_creadas` lists the ones that did (`runId`, `programada`), and `details.fechas_sin_encolar` the ones that did not: preview again with only those dates |

```json
{
  "code": 409,
  "error": "Conflict - The resource state conflicts with this request",
  "details": {
    "code": "CONFLICT",
    "message": "Platica refused the operation",
    "error": "Algo cambió desde la vista previa: la audiencia.",
    "motivo": "stale",
    "cambio": ["audiencia"]
  }
}
```

See [Errors](/api-reference/errors) for the full shape of an error.

An error response never carries a `confirmation`.
