Sending your first campaign safely
Send one message to many people without hurting your number: test, vary the text, watch progress by webhook.
A campaign is the safe way to message many people: Mursilat skips invalid and opted-out numbers and pauses on bad signals. The messaging limit Meta sets for the number applies to campaigns too.
Before you send
- Message only people who agreed to hear from you.
optInConfirmed: trueis your written confirmation and is required. - Outside the 24-hour customer-service window, official numbers can only send Meta-approved templates, and Meta sets each number’s messaging limit and quality rating.
- Official numbers send campaigns as an approved Meta template:
content: {type: "template", template: {name, language, params}}; other content types answerCLOUD_API_TEMPLATE_REQUIRED. A new account’s first campaign waits inpending_reviewuntil Mursilat reviews it. - No URL shorteners.
1. Create it as a draft and test on yourself
Create the campaign with start: false and two or three of your own numbers as recipients. Check what arrives on the phones, then create the real one.
curl -X POST "https://mursilat.com/api/v2/campaigns" \
-H "Authorization: Bearer $WASLA_API_KEY" \
-H "Idempotency-Key: order-1042-confirm" \
-H "Content-Type: application/json" \
-d '{
"numberId": "cm1abcd2345efgh6789ijkl",
"name": "عرض الجمعة",
"content": {
"type": "template",
"template": {
"name": "friday_offer",
"language": "ar",
"params": [
"{name|عميلنا}",
"20%"
]
}
},
"recipients": [
{
"phone": "201001234567",
"variables": {
"name": "منى"
}
},
{
"phone": "966501234567"
}
],
"optInConfirmed": true
}'const res = await fetch('https://mursilat.com/api/v2/campaigns', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WASLA_API_KEY}`,
'Idempotency-Key': 'order-1042-confirm',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"numberId": "cm1abcd2345efgh6789ijkl",
"name": "عرض الجمعة",
"content": {
"type": "template",
"template": {
"name": "friday_offer",
"language": "ar",
"params": [
"{name|عميلنا}",
"20%"
]
}
},
"recipients": [
{
"phone": "201001234567",
"variables": {
"name": "منى"
}
},
{
"phone": "966501234567"
}
],
"optInConfirmed": true
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);import os
import requests
headers = {"Authorization": f"Bearer {os.environ['WASLA_API_KEY']}", "Idempotency-Key": "order-1042-confirm"}
res = requests.post(
"https://mursilat.com/api/v2/campaigns",
headers=headers,
json={
"numberId": "cm1abcd2345efgh6789ijkl",
"name": "عرض الجمعة",
"content": {
"type": "template",
"template": {
"name": "friday_offer",
"language": "ar",
"params": [
"{name|عميلنا}",
"20%"
]
}
},
"recipients": [
{
"phone": "201001234567",
"variables": {
"name": "منى"
}
},
{
"phone": "966501234567"
}
],
"optInConfirmed": True
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)<?php
$ch = curl_init('https://mursilat.com/api/v2/campaigns');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WASLA_API_KEY'),
'Idempotency-Key: order-1042-confirm',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'numberId' => 'cm1abcd2345efgh6789ijkl',
'name' => 'عرض الجمعة',
'content' => [
'type' => 'template',
'template' => [
'name' => 'friday_offer',
'language' => 'ar',
'params' => [
'{name|عميلنا}',
'20%'
]
]
],
'recipients' => [
[
'phone' => '201001234567',
'variables' => [
'name' => 'منى'
]
],
[
'phone' => '966501234567'
]
],
'optInConfirmed' => true
], JSON_UNESCAPED_UNICODE),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data['error']['code'] . ': ' . $data['error']['message']); }
print_r($data);2. Opt-outs
Nothing is appended to campaign messages (an approved template’s text can’t change), so put the opt-out in the template: a quick-reply “Stop” button or a footer. Anyone who answers with an opt-out keyword joins your suppression list, triggers a contact.opted_out webhook and is skipped in every later campaign and send.
3. Watch it
Subscribe to campaign.status and read progress with GET /v2/campaigns/{campaignId} (counts, pause reason). Mursilat pauses a campaign by itself when delivery drops below 80 % over the last hour, when more than 3 in 100 people opt out, or when Meta rate-limits the number — first for 1 hour, then 24 hours. Fix the cause before resuming.
- GETProgress and pause reason
/v2/campaigns/{campaignId} - GETRecipients and button replies
/v2/campaigns/{campaignId}/recipients - POSTPause
/v2/campaigns/{campaignId}/pause - POSTResume
/v2/campaigns/{campaignId}/resume
4. After it ends
Within 24 hours of the end, the campaign’s text, media link, buttons and every recipient row are deleted. The totals stay (purged: true); recipients answer 410 CAMPAIGN_PURGED. Export what you need before that.