Skip to content

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

    العربية
    On this page

    Messages

    Send a message (any type)

    POST/v2/messages
    • Scope:messages:send
    • Idempotency-Key:required
    • number key ok— Also accepts the legacy per-number x-api-key, for its own number.
    • sends messages

    Types: text, image, video, audio, voice, document, sticker, location, contact, buttons, list, cta_url and template. Meta’s 24-hour rule applies: free-form types reach only a customer who wrote to the number in the last 24 hours (else 409 CLOUD_API_WINDOW_CLOSED); type "template" sends an approved template at any time — see Send a template. Scheduling (scheduleAt) is available on request — see Schedule a message.

    Request

    curl -X POST "https://mursilat.com/api/v2/messages" \
      -H "Authorization: Bearer $WASLA_API_KEY" \
      -H "Idempotency-Key: order-1042-confirm" \
      -H "Content-Type: application/json" \
      -d '{
      "numberId": "cm1abcd2345efgh6789ijkl",
      "to": "201001234567",
      "type": "text",
      "text": "طلبك اتشحن 🚚 *شكرًا*",
      "reference": "order-1042"
    }'
    Request — JSON
    {
      "numberId": "cm1abcd2345efgh6789ijkl",
      "to": "201001234567",
      "type": "text",
      "text": "طلبك اتشحن 🚚 *شكرًا*",
      "reference": "order-1042"
    }

    Response

    200Example

    200 — application/json
    {
      "id": "3EB0A1B2C3D4E5F60718",
      "numberId": "cm1abcd2345efgh6789ijkl",
      "status": "sent",
      "type": "text",
      "reference": "order-1042",
      "scheduledAt": null,
      "interactionId": null,
      "format": null,
      "fallbackIncluded": null,
      "estimatedDelayMs": null
    }

    Fields in this response

    Fields of the example answer. Expand objects and arrays.

    • responseobject10 fields
      • idstring "3EB0A1B2C3D4E5F60718"
      • numberIdstring "cm1abcd2345efgh6789ijkl"
      • statusstring "sent"
      • typestring "text"
      • referencestring "order-1042"
      • scheduledAtnull null
      • interactionIdnull null
      • formatnull null
      • fallbackIncludednull null
      • estimatedDelayMsnull null

    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.
    torequiredTypestringConstraints—DescriptionRecipient: international digits without + or leading zeros (e.g. 201001234567, 966501234567).
    typerequiredTypestringConstraints—DescriptionMessage type: text, image, video, audio, voice, document, sticker, location, contact, buttons, list, cta_url. Each type has its own fields — see the table below.
    textoptionalTypestringConstraints—DescriptionMessage text. WhatsApp formatting passes through (*bold*, _italic_, ~strike~).
    referenceoptionalTypestringConstraints≤ 128 charsDescriptionYour own id (order number, ticket…). Echoed in message.status / interactive.reply webhooks and filterable in GET /v2/messages.
    scheduleAtoptionalTypestring (date-time)Constraints—DescriptionISO 8601 time 1 minute – 30 days ahead. Available on request (otherwise 422 SCHEDULING_DISABLED).

    Message types

    typeFieldsNotes
    textFieldstext (1–4096), linkPreviewNotesWhatsApp formatting passes through. A preview of the first https link is built safely when possible.
    imageFieldsmedia, caption ≤ 1024NotesJPEG · PNG · WebP, ≤ 5 MB.
    videoFieldsmedia, captionNotesMP4 · 3GPP, ≤ 16 MB.
    audioFieldsmediaNotesOGG · MP3 · M4A · AAC · AMR, ≤ 16 MB. Shown as an audio file.
    voiceFieldsmediaNotesShown as a voice note (OGG/Opus keeps the waveform).
    documentFieldsmedia, fileName ≤ 120, captionNotesAny file except programs, ≤ 100 MB.
    stickerFieldsmediaNotesWebP ≤ 500 KB as is; PNG / JPG / GIF ≤ 5 MB are converted.
    locationFieldslatitude, longitude, name ≤ 100, address ≤ 200NotesA static pin (live location can’t be sent).
    contactFieldscontacts[] 1–5: name, phones[] 1–3, email, organizationNotesThe vCard is built on the server.
    buttonsFieldsbody.text, buttons[] 1–3, header, footer, fallbackNotesNumbered fallback by default; answers arrive as interactive.reply.
    listFieldsbody.text, list.buttonText, list.sections[] (≤ 10 rows)NotesA menu button that opens the rows.
    cta_urlFieldsbody.text, cta.title ≤ 20, cta.urlNotesOne link button; link rules apply to the URL.

    Errors

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

    • 400 · NUMBER_ID_REQUIRED — numberId is required with an account key.

      Send numberId.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "NUMBER_ID_REQUIRED",
          "message": "numberId is required with an account key.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#NUMBER_ID_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · INVALID_RECIPIENT — Invalid recipient.

      Digits with country code, e.g. 201001234567, or a WhatsApp user id (BSUID), e.g. EG.4110857709215331.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "INVALID_RECIPIENT",
          "message": "Invalid recipient.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#INVALID_RECIPIENT",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · MESSAGE_TYPE_NOT_SUPPORTED — This message type cannot be sent.

      details.reason explains; use the suggested alternative.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "MESSAGE_TYPE_NOT_SUPPORTED",
          "message": "This message type cannot be sent.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#MESSAGE_TYPE_NOT_SUPPORTED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 422 · SAFETY_SUPPRESSED — The recipient opted out (also blocks free-form replies inside the 24-hour window).

      Do not message them.

      Correct the cause before repeating the request.

      HTTP 422 · application/json
      {
        "error": {
          "code": "SAFETY_SUPPRESSED",
          "message": "The recipient opted out (also blocks free-form replies inside the 24-hour window).",
          "docsUrl": "https://mursilat.com/developers/v2/errors#SAFETY_SUPPRESSED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 403 · MESSAGES_QUOTA_EXCEEDED — No messages left in your plan.

      Buy a message pack or upgrade.

      Correct the cause before repeating the request.

      HTTP 403 · application/json
      {
        "error": {
          "code": "MESSAGES_QUOTA_EXCEEDED",
          "message": "No messages left in your plan.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#MESSAGES_QUOTA_EXCEEDED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · SCHEDULE_AT_INVALID — scheduleAt must be 1 minute – 30 days ahead (ISO 8601).

      Send an ISO time like 2026-11-01T09:00:00+02:00.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "SCHEDULE_AT_INVALID",
          "message": "scheduleAt must be 1 minute – 30 days ahead (ISO 8601).",
          "docsUrl": "https://mursilat.com/developers/v2/errors#SCHEDULE_AT_INVALID",
          "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
    • 409 · CLOUD_API_WINDOW_CLOSED — The customer has not written in the last 24 hours: only an approved template can be sent.

      Send type "template", or wait until the customer writes to you.

      Correct the cause before repeating the request.

      HTTP 409 · application/json
      {
        "error": {
          "code": "CLOUD_API_WINDOW_CLOSED",
          "message": "The customer has not written in the last 24 hours: only an approved template can be sent.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CLOUD_API_WINDOW_CLOSED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · CLOUD_API_UNSUPPORTED — This message type is not available on official numbers.

      Use text, media, location, contact, buttons, list, cta_url or template.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "CLOUD_API_UNSUPPORTED",
          "message": "This message type is not available on official numbers.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CLOUD_API_UNSUPPORTED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · CLOUD_API_SEND_FAILED — Meta refused the message (the message says why, e.g. template not approved or wrong parameters).

      Fix the template name, language or parameters and retry.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "CLOUD_API_SEND_FAILED",
          "message": "Meta refused the message (the message says why, e.g. template not approved or wrong parameters).",
          "docsUrl": "https://mursilat.com/developers/v2/errors#CLOUD_API_SEND_FAILED",
          "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

    Recipients: "to" is the phone with country code, or — for a WhatsApp user who turned on a username and hid the phone — the user id Meta sends instead (BSUID, e.g. "EG.4110857709215331"; it comes in message.received webhooks). A BSUID is case-sensitive: send it exactly as received. Opt-outs are checked under both the phone and the BSUID of the same person.

    Under load the answer is still 200 with status "queued" and estimatedDelayMs.

    24-hour rule: the window opens (or re-opens) each time the customer writes to the number and closes 24 hours later. Outside it, only type "template" is accepted. Your own replies do not re-open it.

    Interactive limits (Meta): buttons ≤ 3 (title ≤ 20 chars); list ≤ 10 rows in ≤ 10 sections (row title ≤ 24, description ≤ 72, button ≤ 20); cta_url title ≤ 20 and an https link; body ≤ 1024, header / footer ≤ 60. A message over these limits is sent as numbered plain text so the customer can still answer.

    Media limits: image ≤ 5 MB (JPEG / PNG / WebP), video ≤ 16 MB (MP4 / 3GP), audio and voice ≤ 16 MB, document ≤ 100 MB, sticker WebP 512×512 (≤ 100 kB static, ≤ 500 kB animated; other images are converted). Polls, events and live location cannot be sent from official numbers.

    Meta’s rules: outside the 24-hour customer-service window only Meta-approved templates can be sent, and Meta sets each number’s messaging limit and quality rating.

    Refused: opted-out recipients (422 SAFETY_SUPPRESSED), blocked content such as URL shorteners (422 SAFETY_CONTENT_BLOCKED), a number paused by Mursilat (423 SAFETY_NUMBER_PAUSED) or banned (403 SAFETY_NUMBER_BANNED). Don’t retry these unchanged.

    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/messages