Campaigns
Campaigns with Meta-approved templates: create, choose the audience, preview the cost before sending, send now, schedule or stagger, pause and resume.
List campaigns
GET/campaigns
Campaigns with their status, sender number, template and figures (stats: sent, delivered, read, replied, failed). Tabs (tab): all, sending, scheduled, drafts, errors, finished. summary sums up the period (days).
Scopes: campaigns:read
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
page | query | number | default: 1 · 1 – … |
pageSize | query | number | default: 20 · 1 – 100 |
tab | query | string | all · sending · scheduled · drafts · errors · finished |
category | query | string | MARKETING · UTILITY · AUTHENTICATION |
phoneNumberId | query | uuid | |
q | query | string | 0–100 characters |
days | query | number | 1 – 365 |
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns?page=1&pageSize=20" \
-H "Authorization: Bearer $WM_API_KEY"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();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
$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);{
"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
}
}Create a campaign (draft)
POST/campaigns
Name, sender number and approved template. If the template has variables, variables says where each one comes from (a contact field such as {{fullName}} or fixed text); without them, sending responds 400 CAMPAIGN_VARIABLES_REQUIRED. The campaign starts as a draft: then add the audience, check the cost and send.
Scopes: campaigns:write
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
Idempotency-Key | header | string | 1–255 characters |
Request body CreateCampaign
| Name | Type | Values |
|---|---|---|
name required | string | 2–… characters |
phoneNumberId required | uuid | |
templateId required | uuid | |
scheduledAt | string | |
variables | object | |
todoEnUno | boolean | |
brainConfig | BrainConfig |
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 %"
}
}'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();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
$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);{
"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": []
}See the cost of sending a template
POST/campaigns/send-to-contact/{contactId}/preview
Works out what sending the template to this contact would cost and whether the balance covers it, without sending or saving anything. Returns the contact, the template, the line that would send it, the final cost and the balance before and after. Returns 400 if the contact withdrew consent, the template is not approved or no line is connected. Needs templates:send or campaigns:write.
Scopes: campaigns:write templates:send
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
contactId required | path | string | |
Idempotency-Key | header | string | 1–255 characters |
Request body SendToContact
| Name | Type | Values |
|---|---|---|
templateId required | uuid | |
phoneNumberId | uuid | |
variables | object |
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}/preview" \
-H "Authorization: Bearer $WM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
"phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
"variables": {
"1": "Laura"
}
}'const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}/preview', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WM_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
"phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
"variables": {
"1": "Laura"
}
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}/preview",
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
json={
"templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
"phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
"variables": {
"1": "Laura"
}
},
timeout=30,
)
r.raise_for_status()
data = r.json()<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}/preview');
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([
'templateId' => 'e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b',
'phoneNumberId' => 'c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f',
'variables' => [
'1' => 'Laura'
]
]),
]);
$data = json_decode(curl_exec($ch), true);{
"contact": {
"id": "0b1c2d3e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"fullName": "Laura Pérez"
},
"template": {
"id": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
"name": "aviso_cita",
"language": "es",
"category": "UTILITY"
},
"line": {
"id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
"numberE164": "+34911222333"
},
"estimatedCost": 0.05,
"currency": "EUR",
"wallet": {
"balance": 10,
"afterSend": 9.95,
"sufficient": true
}
}Send a template to a contact
POST/campaigns/send-to-contact/{contactId}
Sends an approved template to a contact and spends balance. Check the cost first with the /preview route. Without phoneNumberId, the first line you connected is used. Use Idempotency-Key so a retry does not send twice. Needs templates:send or campaigns:write.
Scopes: campaigns:write templates:send
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
contactId required | path | string | |
Idempotency-Key | header | string | 1–255 characters |
Request body SendToContact
| Name | Type | Values |
|---|---|---|
templateId required | uuid | |
phoneNumberId | uuid | |
variables | object |
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}" \
-H "Authorization: Bearer $WM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
"phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
"variables": {
"1": "Laura"
}
}'const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WM_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
"phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
"variables": {
"1": "Laura"
}
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}",
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
json={
"templateId": "e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b",
"phoneNumberId": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
"variables": {
"1": "Laura"
}
},
timeout=30,
)
r.raise_for_status()
data = r.json()<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/campaigns/send-to-contact/{contactId}');
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([
'templateId' => 'e6f7a8b9-c0d1-4e2f-8a3b-4c5d6e7f8a9b',
'phoneNumberId' => 'c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f',
'variables' => [
'1' => 'Laura'
]
]),
]);
$data = json_decode(curl_exec($ch), true);No response example yet.
Get a campaign
GET/campaigns/{id}
Detail with figures, template, number, scheduling, estimated and actual cost, errors grouped by reason and latest replies.
Scopes: campaigns:read
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
id required | path | string |
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}" \
-H "Authorization: Bearer $WM_API_KEY"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();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
$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);{
"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": []
}Campaign recipients
GET/campaigns/{id}/recipients
Each recipient with their status (PENDING, SENT, DELIVERED, READ, REPLIED, FAILED), the market used for pricing, the cost and the failure reason if there was one. filter narrows by status.
Scopes: campaigns:read
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
id required | path | string | |
page | query | number | default: 1 · 1 – … |
pageSize | query | number | default: 20 · 1 – 100 |
filter | query | string | all · delivered · read · replied · failed · pending |
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/recipients?page=1&pageSize=20" \
-H "Authorization: Bearer $WM_API_KEY"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();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
$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);{
"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
}
}Add audience
POST/campaigns/{id}/recipients
One of four sources: a list of ids (contactIds, up to 20,000), a stage (lifecycleStageId), a tag (tag) or all: true for everyone. Only contacts with consent and a phone number are included; the response says how many were left out and why, how many were added (added) and how many were already in (alreadyIn).
Scopes: campaigns:write
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
id required | path | string | |
Idempotency-Key | header | string | 1–255 characters |
Request body Audience
| Name | Type | Values |
|---|---|---|
contactIds | uuid[] | |
lifecycleStageId | uuid | |
all | boolean | |
tag | string | 0–60 characters |
country | string | ^[A-Z]{2}$ |
variable1 | string | 0–160 characters |
variable2 | string | 0–160 characters |
limit | number | 1 – 20000 |
excludeRecentDays | number | 1 – 365 |
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"
}'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();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
$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);{
"total": 1217,
"optedOut": 14,
"withoutPhone": 3,
"unpriceable": 0,
"eligible": 1200,
"added": 1200,
"alreadyIn": 0,
"totalRecipients": 1200
}Estimated cost
GET/campaigns/{id}/preview-cost
Before sending: how many recipients will be charged, the final price per message in each destination market (based on the prefix of the receiving number) and the total in your organization's currency. Phones without a valid prefix are neither sent nor charged. wallet.sufficient says whether the balance is enough; includedUtilityRemaining is the number of included Utility messages left (Utility templates only).
Scopes: campaigns:read
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
id required | path | string |
curl "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/preview-cost" \
-H "Authorization: Bearer $WM_API_KEY"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();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
$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);{
"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
}Send, schedule or stagger
POST/campaigns/{id}/send
when: now (or no body) sends immediately; scheduled with scheduledAt (ISO 8601 with time zone, at least one minute in the future) leaves it scheduled; staggered splits it into batches of batchSize (10 to 5,000) every batchIntervalMin minutes (1 to 1,440). The batch cost is charged to the wallet before calling Meta; if the balance isn't enough, it responds 400 "Saldo insuficiente en la wallet." (insufficient wallet balance) and the campaign stays as it was. Responds with the campaign and its new status.
Scopes: campaigns:write
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
id required | path | string | |
Idempotency-Key | header | string | 1–255 characters |
Request body SendCampaign
| Name | Type | Values |
|---|---|---|
when | string | now · scheduled · staggered |
scheduledAt | string | |
batchSize | number | 10 – 5000 |
batchIntervalMin | number | 1 – 1440 |
Common errors
- 400
CAMPAIGN_VARIABLES_REQUIREDThe template has variables and the campaign doesn't say where they come from. - 400 "Saldo insuficiente en la wallet." (insufficient wallet balance): top up from the dashboard and send again.
- 400 "La campaña ya fue enviada o está en un estado inválido." (the campaign was already sent or is in an invalid state): only drafts and scheduled campaigns can be sent.
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
}'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();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
$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);{
"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": []
}Pause
POST/campaigns/{id}/pause
Stops sending what remains; what has already been sent can't be recalled. Only for campaigns that are currently sending.
Scopes: campaigns:write
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
id required | path | string | |
Idempotency-Key | header | string | 1–255 characters |
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/pause" \
-H "Authorization: Bearer $WM_API_KEY"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();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
$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);{
"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": []
}Resume
POST/campaigns/{id}/resume
Continues a paused campaign from where it left off (including those paused for insufficient balance, once the wallet has been topped up).
Scopes: campaigns:write
Parameters
| Name | Where | Type | Values |
|---|---|---|---|
id required | path | string | |
Idempotency-Key | header | string | 1–255 characters |
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/campaigns/{id}/resume" \
-H "Authorization: Bearer $WM_API_KEY"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();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
$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);{
"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": []
}Schemas
BrainConfig
| Name | Type | Values |
|---|---|---|
objetivo required | string | VENDER · COBRAR · AGENDAR · REACTIVAR · INFORMAR |
reglas required | BrainRules | |
seguimiento | BrainFollowUp |