Skip to content

    Arabic or English · ↑↓ to move · Enter to open · Esc to close

    العربية
    On this page

    Campaigns (bulk)

    Create and start a campaign

    POST/v2/campaigns
    • Scope:campaigns:write
    • Idempotency-Key:required
    • sends messages

    Official WhatsApp numbers send campaigns as an approved Meta template: content {type: "template", template: {name, language, params, header?, buttons?}}. params fill {{1}}, {{2}}… of the template body in order and may use each recipient's {variables} (e.g. "{name|عميلنا}"); header fills a media header (link or mediaId) or a text header variable; buttons fill dynamic URL suffixes and copy codes. Other content types (text, media, location, contact, cta_url, buttons, list) answer 400 CLOUD_API_TEMPLATE_REQUIRED on an official number before anything is created. Recipients inline (≤10 000 with variables), contactListId or audience.

    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": "template",
        "template": {
          "name": "friday_offer",
          "language": "ar",
          "params": [
            "{name|عميلنا}",
            "20%"
          ]
        }
      },
      "recipients": [
        {
          "phone": "201001234567",
          "variables": {
            "name": "منى"
          }
        },
        {
          "phone": "966501234567"
        }
      ],
      "optInConfirmed": true
    }'
    Request — 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
    }

    Response

    201Example

    201 — application/json
    {
      "id": "cm2camp0001xyz",
      "numberId": "cm1abcd2345efgh6789ijkl",
      "name": "عرض الجمعة",
      "status": "scheduled",
      "contentType": "template",
      "createdVia": "api",
      "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,
      "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
      }
    }

    Fields in this response

    Fields of the example answer. Expand objects and arrays.

    • responseobject18 fields
      • idstring "cm2camp0001xyz"
      • numberIdstring "cm1abcd2345efgh6789ijkl"
      • namestring "عرض الجمعة"
      • statusstring "scheduled"
      • contentTypestring "template"
      • createdViastring "api"
      • 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
      • 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

    Parameters

    Headers

    NameTypeConstraintsDescription
    Idempotency-KeyrequiredTypestringConstraints≤ 191 charsDescriptionYour 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-IdoptionalTypestringConstraints—DescriptionOptional: your own request id, echoed back (otherwise we generate req_…). Quote it to support.

    Body

    NameTypeConstraintsDescription
    numberIdrequiredTypestringConstraints—DescriptionNumber to act on (id from GET /v2/numbers). A key restricted to some numbers can use only those.
    namerequiredTypestringConstraints≤ 120 charsDescriptionCampaign name for your reports (≤ 120).
    contentrequiredTypeobjectConstraints—DescriptionWhat to send: an approved Meta template, { "type": "template", "template": { … } }. Other content types answer CLOUD_API_TEMPLATE_REQUIRED.
    content.typerequiredTypestringConstraintsone of: templateDescriptionAlways template.
    content.templateoptionalTypeobjectConstraints—DescriptionThe approved template to send to every recipient.
    content.template.namerequiredTypestringConstraints—DescriptionTemplate name exactly as approved by Meta (e.g. order_shipped). Not approved yet → 409 TEMPLATE_NOT_APPROVED.
    content.template.languagerequiredTypestringConstraints—DescriptionLanguage code of the approved template (e.g. ar, en_US).
    content.template.paramsoptionalTypestring[]Constraints≤ 20 itemsDescriptionValues of {{1}}, {{2}}… in order (≤ 20); may use {name|fallback} and the other recipient variables.
    content.template.headeroptionalTypeobjectConstraints—DescriptionMedia header: {format: IMAGE | VIDEO | DOCUMENT, link (https) | mediaId, filename}; text header with {{1}}: {format: TEXT, text}.
    content.template.buttonsoptionalTypeobject[]Constraints≤ 10 itemsDescriptionValues for the template’s dynamic buttons (≤ 10).
    content.template.buttons[].indexoptionalTypeintegerConstraints0–9DescriptionButton position in the template, from 0.
    content.template.buttons[].subTypeoptionalTypestringConstraintsone of: url · copy_codeDescriptionurl (dynamic link suffix) or copy_code (code to copy).
    content.template.buttons[].valueoptionalTypestringConstraints≤ 2000 charsDescriptionThe URL suffix or the code (≤ 2000).
    recipientsoptionalTypeobject[]Constraints≤ 10000 itemsDescriptionInline audience (≤ 10 000). Or use contactListId / audience instead.
    recipients[].phoneoptionalTypestringConstraints—DescriptionRecipient number, international digits. Invalid and opted-out numbers are skipped, never sent.
    recipients[].variablesoptionalTypeobjectConstraints—DescriptionValues for {placeholders} in the content, e.g. { "name": "Mona" }.
    contactListIdoptionalTypestringConstraints—DescriptionSend to a saved contact list instead of inline recipients.
    audienceoptionalTypeobjectConstraints—DescriptionSelect contacts by lists and tags.
    audience.listIdsoptionalTypearrayConstraints—DescriptionContact list ids to include.
    audience.tagsoptionalTypearrayConstraints—DescriptionContacts with any of these tags.
    audience.excludeTagsoptionalTypearrayConstraints—DescriptionSkip contacts with any of these tags.
    optInConfirmedrequiredTypebooleanConstraintsmust be trueDescriptionMust be true: you confirm every recipient agreed to hear from you. Required for every campaign.
    scheduleAtoptionalTypestring (date-time)Constraints—DescriptionStart later (ISO 8601).
    startoptionalTypebooleanConstraintsdefault trueDescriptionfalse creates a draft; start it later with POST /v2/campaigns/{id}/start. Drafts never started are deleted after 30 days.
    speedoptionalTypeanyConstraints—DescriptionIgnored (pacing was removed: Meta sets the messaging limits). Still accepted for one version; will be rejected later.
    maxPerMinuteoptionalTypeanyConstraints—DescriptionIgnored (pacing was removed). Still accepted for one version; will be rejected later.
    maxPerHouroptionalTypeanyConstraints—DescriptionIgnored (pacing was removed). Still accepted for one version; will be rejected later.
    maxPerDayoptionalTypeanyConstraints—DescriptionIgnored (pacing was removed). Still accepted for one version; will be rejected later.

    Errors

    Besides the authentication, rate-limit and validation errors every endpoint can return:

    • 422 · CAMPAIGN_OPT_IN_REQUIRED — Confirm that recipients agreed to receive your messages.

      Send optInConfirmed: true (only for real opt-ins).

      Correct the cause before repeating the request.

      HTTP 422 · application/json
      {
        "error": {
          "code": "CAMPAIGN_OPT_IN_REQUIRED",
          "message": "Confirm that recipients agreed to receive your messages.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CAMPAIGN_OPT_IN_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · CLOUD_API_TEMPLATE_REQUIRED — Campaigns from an official number must use an approved Meta template.

      Send content {type: "template", template: {name, language, params}}; buttons and media go inside the template.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "CLOUD_API_TEMPLATE_REQUIRED",
          "message": "Campaigns from an official number must use an approved Meta template.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CLOUD_API_TEMPLATE_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 409 · TEMPLATE_NOT_APPROVED — This template is not approved by Meta on this number (or the name / language is wrong).

      Check name + language on the Templates page, sync templates, and wait for APPROVED (template.status).

      Correct the cause before repeating the request.

      HTTP 409 · application/json
      {
        "error": {
          "code": "TEMPLATE_NOT_APPROVED",
          "message": "This template is not approved by Meta on this number (or the name / language is wrong).",
          "docsUrl": "https://mursilat.com/developers/v2/errors#TEMPLATE_NOT_APPROVED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · TEMPLATE_PARAMS_MISMATCH — The number of template variables does not match the approved template. (Meta 132000; also as message.status failed)

      Send exactly one value per {{n}} of the approved template.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "TEMPLATE_PARAMS_MISMATCH",
          "message": "The number of template variables does not match the approved template. (Meta 132000; also as message.status failed)",
          "docsUrl": "https://mursilat.com/developers/v2/errors#TEMPLATE_PARAMS_MISMATCH",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · CAMPAIGN_CONTENT_INVALID — Invalid campaign content.

      See details.field.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "CAMPAIGN_CONTENT_INVALID",
          "message": "Invalid campaign content.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CAMPAIGN_CONTENT_INVALID",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · CAMPAIGN_RECIPIENTS_REQUIRED — Give recipients, contactListId or audience (exactly one).

      Pick one source.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "CAMPAIGN_RECIPIENTS_REQUIRED",
          "message": "Give recipients, contactListId or audience (exactly one).",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CAMPAIGN_RECIPIENTS_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 422 · CAMPAIGN_TOO_MANY_RECIPIENTS — At most 10 000 inline recipients.

      Use a contact list.

      Correct the cause before repeating the request.

      HTTP 422 · application/json
      {
        "error": {
          "code": "CAMPAIGN_TOO_MANY_RECIPIENTS",
          "message": "At most 10 000 inline recipients.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CAMPAIGN_TOO_MANY_RECIPIENTS",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 422 · CAMPAIGN_NO_RECIPIENTS — No valid recipients.

      Check the phone numbers.

      Correct the cause before repeating the request.

      HTTP 422 · application/json
      {
        "error": {
          "code": "CAMPAIGN_NO_RECIPIENTS",
          "message": "No valid recipients.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CAMPAIGN_NO_RECIPIENTS",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · URL_SHORTENER — Link shorteners are blocked.

      Use the full link.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "URL_SHORTENER",
          "message": "Link shorteners are blocked.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#URL_SHORTENER",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 403 · FEATURE_NOT_IN_PLAN — Your plan does not include this feature.

      Upgrade (details.feature).

      Correct the cause before repeating the request.

      HTTP 403 · application/json
      {
        "error": {
          "code": "FEATURE_NOT_IN_PLAN",
          "message": "Your plan does not include this feature.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#FEATURE_NOT_IN_PLAN",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · IDEMPOTENCY_KEY_REQUIRED — Idempotency-Key header is required.

      Send one unique value per logical request.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "IDEMPOTENCY_KEY_REQUIRED",
          "message": "Idempotency-Key header is required.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#IDEMPOTENCY_KEY_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · IDEMPOTENCY_KEY_INVALID — Idempotency-Key must be 1–191 visible ASCII characters.

      Use e.g. order-1042-confirm.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "IDEMPOTENCY_KEY_INVALID",
          "message": "Idempotency-Key must be 1–191 visible ASCII characters.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#IDEMPOTENCY_KEY_INVALID",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 409 · IDEMPOTENCY_KEY_REUSED — This Idempotency-Key was used with a different request.

      Use a new key for a new request.

      Correct the cause before repeating the request.

      HTTP 409 · application/json
      {
        "error": {
          "code": "IDEMPOTENCY_KEY_REUSED",
          "message": "This Idempotency-Key was used with a different request.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#IDEMPOTENCY_KEY_REUSED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 409 · IDEMPOTENCY_IN_PROGRESS — The first request with this key is still running.

      Retry in a few seconds.

      Retry after addressing the cause.

      HTTP 409 · application/json
      {
        "error": {
          "code": "IDEMPOTENCY_IN_PROGRESS",
          "message": "The first request with this key is still running.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#IDEMPOTENCY_IN_PROGRESS",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 403 · SCOPE_REQUIRED — The key lacks the scope of this endpoint.

      Add the scope in details.required to the key.

      Correct the cause before repeating the request.

      HTTP 403 · application/json
      {
        "error": {
          "code": "SCOPE_REQUIRED",
          "message": "The key lacks the scope of this endpoint.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#SCOPE_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 401 · API_KEY_REQUIRED — No API key was sent.

      Send Authorization: Bearer wsl_live_…

      Correct the cause before repeating the request.

      HTTP 401 · application/json
      {
        "error": {
          "code": "API_KEY_REQUIRED",
          "message": "No API key was sent.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#API_KEY_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 401 · API_KEY_INVALID — The API key is not valid.

      Copy the key again from Settings → API keys (it is shown only once; create a new one if lost).

      Correct the cause before repeating the request.

      HTTP 401 · application/json
      {
        "error": {
          "code": "API_KEY_INVALID",
          "message": "The API key is not valid.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#API_KEY_INVALID",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 429 · RATE_LIMITED — Rate limit of this key reached.

      Wait Retry-After seconds; watch X-RateLimit-Remaining.

      Retry after addressing the cause.

      HTTP 429 · application/json
      {
        "error": {
          "code": "RATE_LIMITED",
          "message": "Rate limit of this key reached.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#RATE_LIMITED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors

    Errors →

    Behaviour notes

    A new account's first campaign (and every campaign of an account held for review) starts in status pending_review: Mursilat reviews it before it is queued, and a campaign.status webhook tells you when it moves on. Pause / resume answer 400 CAMPAIGN_NOT_RUNNING / CAMPAIGN_NOT_PAUSED until then; cancel works.

    recipients[].phone also accepts the user id (BSUID, e.g. "EG.4110857709215331") of a WhatsApp user who hid the phone behind a username — case-sensitive, sent as Meta’s recipient. In GET …/recipients such a recipient has phone: null and userId set.

    The campaign skips invalid and opted-out numbers; the messaging limit Meta sets for the number applies to it too.

    It pauses 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 example

    Preview — this copy of the docs isn’t on mursilat.com, so the console shows the documented example instead of calling the API.

    Real requests use your real number and plan: they can send WhatsApp messages, spend quota and delete data. (sends messages)

    Kept only in this tab’s memory: never saved, never put in the URL, sent only to mursilat.com. Reloading the page forgets it.

    Send this request for real?

    This will send a real WhatsApp message (or campaign / code) from your number and use your plan quota.

    POST /v2/campaigns