Campaigns (bulk)
Create and start a campaign
/v2/campaigns- Scope:
campaigns:write - Idempotency-Key:required
- sends messages
Content: text, image/video/audio/document (media.url), location, contact, cta_url, buttons, list. Recipients inline (≤10 000 with variables), contactListId or audience.
Parameters
Headers
| Name | Type | Constraints | Description |
|---|---|---|---|
Idempotency-Keyrequired | Typestring | Constraints≤ 191 chars | DescriptionYour unique id for this operation (≤ 191 visible ASCII). A retry with the same key and body returns the first answer with Idempotent-Replayed: true — it never runs twice. Kept 24 h. |
X-Request-Idoptional | Typestring | Constraints— | DescriptionOptional: your own request id, echoed back (otherwise we generate req_…). Quote it to support. |
Body
| Name | Type | Constraints | Description |
|---|---|---|---|
numberIdrequired | Typestring | Constraints— | DescriptionNumber to act on (id from GET /v2/numbers). A key restricted to some numbers can use only those. |
namerequired | Typestring | Constraints≤ 120 chars | DescriptionCampaign name for your reports (≤ 120). |
contentrequired | Typeobject | Constraints— | DescriptionWhat to send: { type, … } with text, image / video / audio / document (media.url), location, contact, cta_url, buttons or list. Use {variable|fallback} and [[spin|tax]] so texts differ. |
recipientsoptional | Typeobject[] | Constraints≤ 10000 items | DescriptionInline audience (≤ 10 000). Or use contactListId / audience instead. |
recipients[].phoneoptional | Typestring | Constraints— | DescriptionRecipient number, international digits. Invalid and opted-out numbers are skipped, never sent. |
recipients[].variablesoptional | Typeobject | Constraints— | DescriptionValues for {placeholders} in the content, e.g. { "name": "Mona" }. |
contactListIdoptional | Typestring | Constraints— | DescriptionSend to a saved contact list instead of inline recipients. |
audienceoptional | Typeobject | Constraints— | DescriptionSelect contacts by lists and tags. |
audience.listIdsoptional | Typearray | Constraints— | DescriptionContact list ids to include. |
audience.tagsoptional | Typearray | Constraints— | DescriptionContacts with any of these tags. |
audience.excludeTagsoptional | Typearray | Constraints— | DescriptionSkip contacts with any of these tags. |
optInConfirmedrequired | Typeboolean | Constraintsmust be true | DescriptionMust be true: you confirm every recipient agreed to hear from you. Required for every campaign. |
speedoptional | Typestring | Constraintsone of: SAFE · NORMAL · FAST | DescriptionPacing preset (default NORMAL). SAFE is the slowest and the best choice for young numbers; every preset stays inside the Number Shield caps. |
scheduleAtoptional | Typestring (date-time) | Constraints— | DescriptionStart later (ISO 8601). Quiet hours still apply. |
startoptional | Typeboolean | Constraintsdefault true | Descriptionfalse creates a draft; start it later with POST /v2/campaigns/{id}/start. Drafts never started are deleted after 30 days. |
Request
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": "cta_url",
"body": {
"text": "أهلاً {name|عميلنا} 👋 خصم 20% لحد الجمعة"
},
"cta": {
"title": "شوف العرض",
"url": "https://example.com/offer?ref={name}"
}
},
"recipients": [
{
"phone": "201001234567",
"variables": {
"name": "منى"
}
},
{
"phone": "966501234567"
}
],
"optInConfirmed": true,
"speed": "SAFE"
}'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": "cta_url",
"body": {
"text": "أهلاً {name|عميلنا} 👋 خصم 20% لحد الجمعة"
},
"cta": {
"title": "شوف العرض",
"url": "https://example.com/offer?ref={name}"
}
},
"recipients": [
{
"phone": "201001234567",
"variables": {
"name": "منى"
}
},
{
"phone": "966501234567"
}
],
"optInConfirmed": true,
"speed": "SAFE"
}),
});
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": "cta_url",
"body": {
"text": "أهلاً {name|عميلنا} 👋 خصم 20% لحد الجمعة"
},
"cta": {
"title": "شوف العرض",
"url": "https://example.com/offer?ref={name}"
}
},
"recipients": [
{
"phone": "201001234567",
"variables": {
"name": "منى"
}
},
{
"phone": "966501234567"
}
],
"optInConfirmed": True,
"speed": "SAFE"
},
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' => 'cta_url',
'body' => [
'text' => 'أهلاً {name|عميلنا} 👋 خصم 20% لحد الجمعة'
],
'cta' => [
'title' => 'شوف العرض',
'url' => 'https://example.com/offer?ref={name}'
]
],
'recipients' => [
[
'phone' => '201001234567',
'variables' => [
'name' => 'منى'
]
],
[
'phone' => '966501234567'
]
],
'optInConfirmed' => true,
'speed' => 'SAFE'
], 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);{
"numberId": "cm1abcd2345efgh6789ijkl",
"name": "عرض الجمعة",
"content": {
"type": "cta_url",
"body": {
"text": "أهلاً {name|عميلنا} 👋 خصم 20% لحد الجمعة"
},
"cta": {
"title": "شوف العرض",
"url": "https://example.com/offer?ref={name}"
}
},
"recipients": [
{
"phone": "201001234567",
"variables": {
"name": "منى"
}
},
{
"phone": "966501234567"
}
],
"optInConfirmed": true,
"speed": "SAFE"
}Response
201Example
{
"id": "cm2camp0001xyz",
"numberId": "cm1abcd2345efgh6789ijkl",
"name": "عرض الجمعة",
"status": "scheduled",
"contentType": "cta_url",
"createdVia": "api",
"speed": "SAFE",
"scheduledAt": null,
"startedAt": "2026-10-13T09:00:00.000Z",
"pausedAt": null,
"completedAt": null,
"pause": null,
"progress": {
"total": 500,
"queued": 380,
"sent": 120,
"delivered": 115,
"read": 70,
"replied": 9,
"failed": 0,
"skipped": 3,
"optOuts": 1,
"percent": 24
},
"replies": null,
"eta": {
"remaining": 380,
"perDayCap": 200,
"remainingToday": 80,
"estimatedMinutesToday": 34,
"extraDays": 2,
"note": "Estimate from the number warm-up caps and pacing."
},
"purged": false,
"purgedAt": null,
"createdAt": "2026-10-13T08:55:00.000Z",
"updatedAt": "2026-10-13T09:30:00.000Z",
"recipientsUpload": {
"total": 2,
"invalid": 0,
"notOnWhatsApp": 0,
"unchecked": 0
}
}Response schema
Fields of the example answer. Expand objects and arrays.
responseobject20 fields
- idstring "cm2camp0001xyz"
- numberIdstring "cm1abcd2345efgh6789ijkl"
- namestring "عرض الجمعة"
- statusstring "scheduled"
- contentTypestring "cta_url"
- createdViastring "api"
- speedstring "SAFE"
- scheduledAtnull null
- startedAtstring "2026-10-13T09:00:00.000Z"
- pausedAtnull null
- completedAtnull null
- pausenull null
progressobject10 fields
- totalinteger 500
- queuedinteger 380
- sentinteger 120
- deliveredinteger 115
- readinteger 70
- repliedinteger 9
- failedinteger 0
- skippedinteger 3
- optOutsinteger 1
- percentinteger 24
- repliesnull null
etaobject6 fields
- remaininginteger 380
- perDayCapinteger 200
- remainingTodayinteger 80
- estimatedMinutesTodayinteger 34
- extraDaysinteger 2
- notestring "Estimate from the number warm-up caps and pacing."
- purgedboolean false
- purgedAtnull null
- createdAtstring "2026-10-13T08:55:00.000Z"
- updatedAtstring "2026-10-13T09:30:00.000Z"
recipientsUploadobject4 fields
- totalinteger 2
- invalidinteger 0
- notOnWhatsAppinteger 0
- uncheckedinteger 0
Errors
Besides the authentication, rate-limit and validation errors every endpoint can return:
- 422CAMPAIGN_OPT_IN_REQUIREDConfirm that recipients agreed to receive your messages.
- 400CAMPAIGN_CONTENT_INVALIDInvalid campaign content.
- 400CAMPAIGN_RECIPIENTS_REQUIREDGive recipients, contactListId or audience (exactly one).
- 422CAMPAIGN_TOO_MANY_RECIPIENTSAt most 10 000 inline recipients.
- 422CAMPAIGN_NO_RECIPIENTSNo valid recipients.
- 400URL_SHORTENERLink shorteners are blocked.
- 403FEATURE_NOT_IN_PLANYour plan does not include this feature.
Number Shield & behaviour
Campaigns over 50 new contacts need a {variable} or [[spintax]] so texts differ.
The Number Shield paces the campaign (speed preset within the warm-up caps), waits during quiet hours (default 22:00–09:00) and skips invalid or opted-out numbers.
It pauses the campaign by itself on low delivery (< 80 % over the last hour), many opt-outs (> 3 per 100) or a WhatsApp rate limit — 1 hour, then 24 hours. You get campaign.status with the reason; platform pauses can’t be lifted early (CAMPAIGN_RESUME_BLOCKED).
Try it
Send this request from your browser to the Mursilat API.
documented examplePreview — this copy of the docs isn’t on mursilat.com, so the console shows the documented example instead of calling the API.
Kept only in this tab’s memory: never saved, never put in the URL, sent only to mursilat.com. Reloading the page forgets it.