Ir al contenido
WhatsMarketingDeveloper Hub

Campañas

Campañas con plantillas aprobadas por Meta: crear, elegir la audiencia, ver el coste antes de enviar, enviar ahora, programar o escalonar, pausar y reanudar.

Listar campañas

GET/campaigns

Campañas con su estado, número emisor, plantilla y cifras (stats: enviados, entregados, leídos, respondidos, fallidos). Pestañas (tab): all, sending, scheduled, drafts, errors, finished. summary resume el periodo (days).

Permisos: campaigns:read

Parámetros

NombreDóndeTipoValores
pageconsultanumberpor defecto: 1 · 1 – …
pageSizeconsultanumberpor defecto: 20 · 1 – 100
tabconsultastringall · sending · scheduled · drafts · errors · finished
categoryconsultastringMARKETING · UTILITY · AUTHENTICATION
phoneNumberIdconsultauuid
qconsultastring0–100 caracteres
daysconsultanumber1 – 365
curl
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns?page=1&pageSize=20" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns?page=1&pageSize=20', {
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.get(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns?page=1&pageSize=20",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns?page=1&pageSize=20');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 200
{
  "data": [
    {
      "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
      "organizationId": "f0e1d2c3-b4a5-4968-8776-655443322110",
      "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
      "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
      "name": "Octubre: promo",
      "status": "COMPLETED",
      "scheduledAt": null,
      "startedAt": "2026-10-10T08:00:00.000Z",
      "completedAt": "2026-10-10T08:12:00.000Z",
      "batchSize": null,
      "batchIntervalMin": null,
      "nextBatchAt": null,
      "pausedAt": null,
      "stopReason": null,
      "sourceCampaignId": null,
      "createdAt": "2026-10-09T16:00:00.000Z",
      "updatedAt": "2026-10-10T08:12:00.000Z",
      "template": {
        "name": "promo_octubre",
        "category": "MARKETING",
        "language": "es"
      },
      "phoneNumber": {
        "numberE164": "+34600000000",
        "displayName": "Clínica Sol"
      },
      "stats": {
        "total": 1200,
        "pending": 0,
        "sent": 1200,
        "delivered": 1174,
        "read": 803,
        "replied": 96,
        "failed": 26,
        "progressPct": 100
      }
    }
  ],
  "meta": {
    "page": 1,
    "pageSize": 20,
    "total": 1,
    "totalPages": 1
  },
  "tabs": {
    "all": 1,
    "sending": 0,
    "scheduled": 0,
    "drafts": 0,
    "errors": 0,
    "finished": 1
  },
  "summary": {
    "days": 30,
    "since": "2026-09-14",
    "campaigns": 1,
    "sent": 1200,
    "deliveredPct": 97.8,
    "readPct": 66.9,
    "replies": 96,
    "repliesPct": 8,
    "spend": 59.85,
    "spendPerMessage": 0.05
  }
}

Crear una campaña (borrador)

POST/campaigns

Nombre, número emisor y plantilla aprobada. Si la plantilla tiene variables, variables dice de dónde sale cada una (campo del contacto como {{fullName}} o texto fijo); sin ellas, el envío responde 400 CAMPAIGN_VARIABLES_REQUIRED. La campaña nace en borrador: después añade la audiencia, consulta el coste y envía.

Permisos: campaigns:write

Cuerpo de la petición CreateCampaign

NombreTipoValores
name obligatoriostring2–… caracteres
phoneNumberId obligatoriouuid
templateId obligatoriouuid
scheduledAtstring
variablesobject
curl
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns" \
  -H "Authorization: Bearer $WM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Octubre: promo",
  "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
  "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
  "variables": {
    "1": "{{fullName}}",
    "2": "15 %"
  }
}'
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Octubre: promo",
    "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
    "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
    "variables": {
      "1": "{{fullName}}",
      "2": "15 %"
    }
  }),
});
const data = await res.json();
Python
import os, requests

r = requests.post(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    json={
        "name": "Octubre: promo",
        "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
        "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
        "variables": {
            "1": "{{fullName}}",
            "2": "15 %"
        }
    },
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'name' => 'Octubre: promo',
    'phoneNumberId' => 'c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f',
    'templateId' => 'e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b',
    'variables' => [
      '1' => '{{fullName}}',
      '2' => '15 %'
    ]
  ]),
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 201
{
  "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
  "organizationId": "f0e1d2c3-b4a5-4968-8776-655443322110",
  "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
  "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
  "name": "Octubre: promo",
  "status": "DRAFT",
  "scheduledAt": null,
  "startedAt": null,
  "completedAt": null,
  "batchSize": null,
  "batchIntervalMin": null,
  "nextBatchAt": null,
  "pausedAt": null,
  "stopReason": null,
  "sourceCampaignId": null,
  "createdAt": "2026-10-09T16:00:00.000Z",
  "updatedAt": "2026-10-09T16:00:00.000Z",
  "template": {
    "id": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
    "name": "promo_octubre",
    "category": "MARKETING",
    "language": "es",
    "bodyText": "Hola {{1}}, este mes tienes un {{2}} de descuento.",
    "status": "APPROVED"
  },
  "phoneNumber": {
    "id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
    "numberE164": "+34600000000",
    "displayName": "Clínica Sol",
    "qualityRating": "GREEN"
  },
  "estimatedCost": null,
  "realCost": 0,
  "stats": {
    "total": 0,
    "pending": 0,
    "sent": 0,
    "delivered": 0,
    "read": 0,
    "replied": 0,
    "failed": 0,
    "progressPct": 0
  },
  "errorsByReason": [],
  "lastReplies": []
}

Ver una campaña

GET/campaigns/{id}

Detalle con cifras, plantilla, número, programación, coste estimado y real, errores agrupados por motivo y últimas respuestas.

Permisos: campaigns:read

Parámetros

NombreDóndeTipoValores
id obligatoriorutastring
curl
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}', {
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.get(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 200
{
  "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
  "organizationId": "f0e1d2c3-b4a5-4968-8776-655443322110",
  "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
  "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
  "name": "Octubre: promo",
  "status": "DRAFT",
  "scheduledAt": null,
  "startedAt": null,
  "completedAt": null,
  "batchSize": null,
  "batchIntervalMin": null,
  "nextBatchAt": null,
  "pausedAt": null,
  "stopReason": null,
  "sourceCampaignId": null,
  "createdAt": "2026-10-09T16:00:00.000Z",
  "updatedAt": "2026-10-09T16:00:00.000Z",
  "template": {
    "id": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
    "name": "promo_octubre",
    "category": "MARKETING",
    "language": "es",
    "bodyText": "Hola {{1}}, este mes tienes un {{2}} de descuento.",
    "status": "APPROVED"
  },
  "phoneNumber": {
    "id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
    "numberE164": "+34600000000",
    "displayName": "Clínica Sol",
    "qualityRating": "GREEN"
  },
  "estimatedCost": null,
  "realCost": 0,
  "stats": {
    "total": 0,
    "pending": 0,
    "sent": 0,
    "delivered": 0,
    "read": 0,
    "replied": 0,
    "failed": 0,
    "progressPct": 0
  },
  "errorsByReason": [],
  "lastReplies": []
}

Destinatarios de una campaña

GET/campaigns/{id}/recipients

Cada destinatario con su estado (PENDING, SENT, DELIVERED, READ, REPLIED, FAILED), el mercado por el que se tarifó, el coste y el motivo del fallo si lo hubo. filter acota por estado.

Permisos: campaigns:read

Parámetros

NombreDóndeTipoValores
id obligatoriorutastring
pageconsultanumberpor defecto: 1 · 1 – …
pageSizeconsultanumberpor defecto: 20 · 1 – 100
filterconsultastringall · delivered · read · replied · failed · pending
curl
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients?page=1&pageSize=20" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients?page=1&pageSize=20', {
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.get(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients?page=1&pageSize=20",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients?page=1&pageSize=20');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 200
{
  "data": [
    {
      "id": "7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
      "contact": {
        "id": "0b1c2d3e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
        "fullName": "Laura Pérez",
        "primaryPhone": "+34612345678"
      },
      "market": "ES",
      "status": "DELIVERED",
      "sentAt": "2026-10-10T08:00:02.000Z",
      "deliveredAt": "2026-10-10T08:00:05.000Z",
      "readAt": null,
      "failedAt": null,
      "errorMessage": null,
      "totalCost": 0.05,
      "coveredByAllowance": false
    }
  ],
  "meta": {
    "page": 1,
    "pageSize": 20,
    "total": 1200,
    "totalPages": 60
  }
}

Añadir audiencia

POST/campaigns/{id}/recipients

Una de cuatro fuentes: lista de ids (contactIds, hasta 20.000), una etapa (lifecycleStageId), una etiqueta (tag) o all: true para todos. Solo entran los contactos con consentimiento y teléfono; la respuesta dice cuántos quedaron fuera y por qué, cuántos entraron (added) y cuántos ya estaban (alreadyIn).

Permisos: campaigns:write

Parámetros

NombreDóndeTipoValores
id obligatoriorutastring

Cuerpo de la petición Audience

NombreTipoValores
contactIdsuuid[]≤ 20000
lifecycleStageIduuid
allboolean
tagstring0–60 caracteres
curl
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients" \
  -H "Authorization: Bearer $WM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "tag": "campaña-octubre"
}'
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "tag": "campaña-octubre"
  }),
});
const data = await res.json();
Python
import os, requests

r = requests.post(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    json={
        "tag": "campaña-octubre"
    },
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'tag' => 'campaña-octubre'
  ]),
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 201
{
  "total": 1217,
  "optedOut": 14,
  "withoutPhone": 3,
  "unpriceable": 0,
  "eligible": 1200,
  "added": 1200,
  "alreadyIn": 0,
  "totalRecipients": 1200
}

Coste previsto

GET/campaigns/{id}/preview-cost

Antes de enviar: cuántos destinatarios se cobran, el precio final por mensaje en cada mercado destino (según el prefijo del número que recibe) y el total en la moneda de tu organización. Los teléfonos sin prefijo válido no se envían ni se cobran. wallet.sufficient dice si el saldo alcanza; includedUtilityRemaining son los mensajes Utility incluidos que quedan (solo plantillas Utility).

Permisos: campaigns:read

Parámetros

NombreDóndeTipoValores
id obligatoriorutastring
curl
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/preview-cost" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/preview-cost', {
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.get(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/preview-cost",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/preview-cost');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 200
{
  "currency": "EUR",
  "recipientCount": 1200,
  "priceableCount": 1197,
  "unpriceableCount": 3,
  "estimatedTotal": 59.85,
  "byMarket": [
    {
      "market": "ES",
      "label": "España",
      "recipientCount": 1100,
      "totalCost": 0.05,
      "subtotal": 55,
      "rateEffectiveFrom": "2026-07-01"
    },
    {
      "market": "AR",
      "label": "Argentina",
      "recipientCount": 97,
      "totalCost": 0.05,
      "subtotal": 4.85,
      "rateEffectiveFrom": "2026-07-01"
    }
  ],
  "wallet": {
    "balance": 120,
    "afterSend": 60.15,
    "sufficient": true
  },
  "includedUtilityRemaining": null
}

Enviar, programar o escalonar

POST/campaigns/{id}/send

when: now (o sin cuerpo) envía al momento; scheduled con scheduledAt (ISO 8601 con zona, al menos un minuto en el futuro) la deja programada; staggered la reparte en tandas de batchSize (10 a 5.000) cada batchIntervalMin minutos (1 a 1.440). El coste del lote se cobra de la wallet antes de llamar a Meta; si el saldo no alcanza, responde 400 «Saldo insuficiente en la wallet.» y la campaña queda como estaba. Responde con la campaña y su nuevo estado.

Permisos: campaigns:write

Parámetros

NombreDóndeTipoValores
id obligatoriorutastring

Cuerpo de la petición SendCampaign

NombreTipoValores
whenstringnow · scheduled · staggered
scheduledAtstring
batchSizenumber10 – 5000
batchIntervalMinnumber1 – 1440

Errores frecuentes

  • 400 CAMPAIGN_VARIABLES_REQUIRED La plantilla tiene variables y la campaña no dice de dónde salen.
  • 400 «Saldo insuficiente en la wallet.»: recarga desde el panel y vuelve a enviar.
  • 400 «La campaña ya fue enviada o está en un estado inválido.»: solo se envían borradores y programadas.
curl
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/send" \
  -H "Authorization: Bearer $WM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "when": "staggered",
  "batchSize": 200,
  "batchIntervalMin": 10
}'
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/send', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "when": "staggered",
    "batchSize": 200,
    "batchIntervalMin": 10
  }),
});
const data = await res.json();
Python
import os, requests

r = requests.post(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/send",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    json={
        "when": "staggered",
        "batchSize": 200,
        "batchIntervalMin": 10
    },
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/send');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'when' => 'staggered',
    'batchSize' => 200,
    'batchIntervalMin' => 10
  ]),
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 201
{
  "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
  "organizationId": "f0e1d2c3-b4a5-4968-8776-655443322110",
  "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
  "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
  "name": "Octubre: promo",
  "status": "DRAFT",
  "scheduledAt": null,
  "startedAt": null,
  "completedAt": null,
  "batchSize": null,
  "batchIntervalMin": null,
  "nextBatchAt": null,
  "pausedAt": null,
  "stopReason": null,
  "sourceCampaignId": null,
  "createdAt": "2026-10-09T16:00:00.000Z",
  "updatedAt": "2026-10-09T16:00:00.000Z",
  "template": {
    "id": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
    "name": "promo_octubre",
    "category": "MARKETING",
    "language": "es",
    "bodyText": "Hola {{1}}, este mes tienes un {{2}} de descuento.",
    "status": "APPROVED"
  },
  "phoneNumber": {
    "id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
    "numberE164": "+34600000000",
    "displayName": "Clínica Sol",
    "qualityRating": "GREEN"
  },
  "estimatedCost": null,
  "realCost": 0,
  "stats": {
    "total": 0,
    "pending": 0,
    "sent": 0,
    "delivered": 0,
    "read": 0,
    "replied": 0,
    "failed": 0,
    "progressPct": 0
  },
  "errorsByReason": [],
  "lastReplies": []
}

Pausar

POST/campaigns/{id}/pause

Detiene el envío de lo que falta; lo ya enviado no se puede retirar. Solo con campañas que están enviando.

Permisos: campaigns:write

Parámetros

NombreDóndeTipoValores
id obligatoriorutastring
curl
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/pause" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/pause', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.post(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/pause",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/pause');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 200
{
  "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
  "organizationId": "f0e1d2c3-b4a5-4968-8776-655443322110",
  "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
  "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
  "name": "Octubre: promo",
  "status": "DRAFT",
  "scheduledAt": null,
  "startedAt": null,
  "completedAt": null,
  "batchSize": null,
  "batchIntervalMin": null,
  "nextBatchAt": null,
  "pausedAt": null,
  "stopReason": null,
  "sourceCampaignId": null,
  "createdAt": "2026-10-09T16:00:00.000Z",
  "updatedAt": "2026-10-09T16:00:00.000Z",
  "template": {
    "id": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
    "name": "promo_octubre",
    "category": "MARKETING",
    "language": "es",
    "bodyText": "Hola {{1}}, este mes tienes un {{2}} de descuento.",
    "status": "APPROVED"
  },
  "phoneNumber": {
    "id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
    "numberE164": "+34600000000",
    "displayName": "Clínica Sol",
    "qualityRating": "GREEN"
  },
  "estimatedCost": null,
  "realCost": 0,
  "stats": {
    "total": 0,
    "pending": 0,
    "sent": 0,
    "delivered": 0,
    "read": 0,
    "replied": 0,
    "failed": 0,
    "progressPct": 0
  },
  "errorsByReason": [],
  "lastReplies": []
}

Reanudar

POST/campaigns/{id}/resume

Continúa una campaña pausada desde donde se quedó (también las que se pausaron por falta de saldo, una vez recargada la wallet).

Permisos: campaigns:write

Parámetros

NombreDóndeTipoValores
id obligatoriorutastring
curl
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/resume" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/resume', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.post(
    "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/resume",
    headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
    timeout=30,
)
r.raise_for_status()
data = r.json()
PHP
<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/resume');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('WM_API_KEY'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
Respuesta 200
{
  "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
  "organizationId": "f0e1d2c3-b4a5-4968-8776-655443322110",
  "phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
  "templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
  "name": "Octubre: promo",
  "status": "DRAFT",
  "scheduledAt": null,
  "startedAt": null,
  "completedAt": null,
  "batchSize": null,
  "batchIntervalMin": null,
  "nextBatchAt": null,
  "pausedAt": null,
  "stopReason": null,
  "sourceCampaignId": null,
  "createdAt": "2026-10-09T16:00:00.000Z",
  "updatedAt": "2026-10-09T16:00:00.000Z",
  "template": {
    "id": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
    "name": "promo_octubre",
    "category": "MARKETING",
    "language": "es",
    "bodyText": "Hola {{1}}, este mes tienes un {{2}} de descuento.",
    "status": "APPROVED"
  },
  "phoneNumber": {
    "id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
    "numberE164": "+34600000000",
    "displayName": "Clínica Sol",
    "qualityRating": "GREEN"
  },
  "estimatedCost": null,
  "realCost": 0,
  "stats": {
    "total": 0,
    "pending": 0,
    "sent": 0,
    "delivered": 0,
    "read": 0,
    "replied": 0,
    "failed": 0,
    "progressPct": 0
  },
  "errorsByReason": [],
  "lastReplies": []
}