Skip to content

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

    العربية
    On this page

    Auto-replies

    Create a rule

    POST/v2/numbers/{numberId}/auto-replies
    • Scope:autoreplies:write
    • Idempotency-Key:optional
    • changes settings

    match: EXACT / CONTAINS / STARTS_WITH compare literal keywords after Arabic normalisation (أ/إ/آ, ى/ي, ة/ه, diacritics). REGEX takes trigger.patterns: RE2 regular expressions (linear time — no catastrophic backtracking). "regex" / "starts_with" in lower case and trigger.matchType are accepted.

    Parameters

    Path

    NameTypeConstraintsDescription
    numberIdrequiredTypestringConstraints—DescriptionNumber id (GET /v2/numbers).

    Headers

    NameTypeConstraintsDescription
    Idempotency-KeyoptionalTypestringConstraints≤ 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
    namerequiredTypestringConstraints≤ 120 charsDescriptionRule name (≤ 120).
    enabledoptionalTypebooleanConstraintsdefault trueDescriptionfalse keeps the rule but stops it from answering.
    triggerrequiredTypeobjectConstraints—DescriptionWhen the rule answers.
    trigger.typeoptionalTypestringConstraintsone of: KEYWORD · FIRST_MESSAGE · AWAYDescriptionKEYWORD (message contains / equals a keyword), FIRST_MESSAGE (welcome a new chat) or AWAY (outside the schedule).
    trigger.matchoptionalTypestringConstraintsone of: EXACT · CONTAINS · STARTS_WITH · REGEXDescriptionEXACT, CONTAINS, STARTS_WITH (literal keywords after Arabic normalisation: أ/إ/آ → ا, ى → ي, ة → ه, diacritics removed) or REGEX (RE2 patterns in trigger.patterns). Any case is accepted (regex, starts_with); trigger.matchType is an alias.
    trigger.keywordsoptionalTypestring[]Constraints≤ 50 itemsDescriptionUp to 50 keywords for EXACT / CONTAINS / STARTS_WITH rules.
    trigger.patternsoptionalTypestring[]Constraints1–10 itemsDescriptionREGEX rules: 1–10 RE2 patterns, ≤ 200 characters each; any match fires the rule. Linear time — no lookarounds or backreferences. Captures go into the reply as {1}, {2} or {groupName}.
    trigger.regexoptionalTypeobjectConstraints—DescriptionREGEX options.
    trigger.regex.ignoreCaseoptionalTypebooleanConstraintsdefault trueDescriptionCase-insensitive matching (default true).
    trigger.regex.normalizeArabicoptionalTypebooleanConstraintsdefault trueDescriptionMatch the Arabic-normalised text: أ/إ/آ → ا, ى → ي, ة → ه, tatweel and diacritics removed, Arabic digits → 0–9 (default true).
    trigger.regex.allowLinksInCapturesoptionalTypebooleanConstraintsdefault falseDescriptionKeep link-like captures (URLs, domains, wa.me / t.me) in the reply (default false: always removed, so a customer can’t make your number send a link of their choice).
    scheduleoptionalTypeobject | nullConstraints—DescriptionBusiness hours (for AWAY rules). null = always.
    schedule.timezoneoptionalTypestringConstraints—DescriptionIANA time zone, e.g. Africa/Cairo, Asia/Riyadh.
    schedule.daysoptionalTypeinteger[]Constraints—DescriptionWorking days, 0 = Sunday … 6 = Saturday.
    schedule.startoptionalTypestringConstraints—DescriptionOpening time HH:mm.
    schedule.endoptionalTypestringConstraints—DescriptionClosing time HH:mm.
    replyrequiredTypeobjectConstraints—DescriptionWhat to answer.
    reply.textoptionalTypestringConstraints≤ 4096 charsDescriptionReply text; {name|fallback} inserts the customer name.
    reply.mediaUrloptionalTypestringConstraints—DescriptionOptional public https:// file to send with the reply.
    reply.mediaTypeoptionalTypestringConstraintsone of: image · video · document · audioDescriptionType of reply.mediaUrl.
    cooldownMinutesoptionalTypeintegerConstraints≥ 0DescriptionDo not answer the same person with this rule again for this many minutes.
    priorityoptionalTypeintegerConstraints—DescriptionOrder when several rules match: the lowest number is checked first (default 0).

    Request

    curl -X POST "https://mursilat.com/api/v2/numbers/cm1abcd2345efgh6789ijkl/auto-replies" \
      -H "Authorization: Bearer $WASLA_API_KEY" \
      -H "Idempotency-Key: order-1042-confirm" \
      -H "Content-Type: application/json" \
      -d '{
      "name": "الأسعار",
      "trigger": {
        "type": "KEYWORD",
        "match": "CONTAINS",
        "keywords": [
          "سعر",
          "بكام",
          "price"
        ]
      },
      "reply": {
        "text": "أهلاً {name|بيك} 👋 الأسعار: https://example.com/prices"
      },
      "cooldownMinutes": 60
    }'
    Request — JSON
    {
      "name": "الأسعار",
      "trigger": {
        "type": "KEYWORD",
        "match": "CONTAINS",
        "keywords": [
          "سعر",
          "بكام",
          "price"
        ]
      },
      "reply": {
        "text": "أهلاً {name|بيك} 👋 الأسعار: https://example.com/prices"
      },
      "cooldownMinutes": 60
    }

    Response

    201Example

    201 — application/json
    {
      "id": "cm3rule0001xyz",
      "sessionId": "cm1abcd2345efgh6789ijkl",
      "scope": "number",
      "name": "الأسعار",
      "enabled": true,
      "trigger": {
        "type": "KEYWORD",
        "match": "CONTAINS",
        "keywords": [
          "سعر",
          "بكام",
          "price"
        ]
      },
      "schedule": null,
      "reply": {
        "text": "أهلاً {name|بيك} 👋 الأسعار: https://example.com/prices"
      },
      "cooldownMinutes": 60,
      "priority": 0,
      "stats": {
        "triggered": 42,
        "lastTriggeredAt": "2026-10-13T07:40:00.000Z"
      },
      "createdAt": "2026-10-01T09:00:00.000Z",
      "updatedAt": "2026-10-10T09:00:00.000Z"
    }

    Response schema

    Fields of the example answer. Expand objects and arrays.

    • responseobject13 fields
      • idstring "cm3rule0001xyz"
      • sessionIdstring "cm1abcd2345efgh6789ijkl"
      • scopestring "number"
      • namestring "الأسعار"
      • enabledboolean true
      • triggerobject3 fields
        • typestring "KEYWORD"
        • matchstring "CONTAINS"
        • keywordsarray3 items
          • [0]string "سعر"
      • schedulenull null
      • replyobject1 fields
        • textstring "أهلاً {name|بيك} 👋 الأسعار: https://example.com/prices"
      • cooldownMinutesinteger 60
      • priorityinteger 0
      • statsobject2 fields
        • triggeredinteger 42
        • lastTriggeredAtstring "2026-10-13T07:40:00.000Z"
      • createdAtstring "2026-10-01T09:00:00.000Z"
      • updatedAtstring "2026-10-10T09:00:00.000Z"

    Errors

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

    Errors →

    Number Shield & behaviour

    REGEX example: {"name":"Order status","trigger":{"type":"KEYWORD","match":"regex","patterns":["(?:طلب|order)\s*#?(?<order>\d{4,8})"]},"reply":{"text":"طلبك رقم {order} بيتجهز 👍"}}. Captures go into the reply as {1}, {2} or {groupName} (escaped, ≤ 100 chars each, ≤ 1,024 chars added in total; link-like captures — URLs, domains, wa.me / t.me — are always removed unless regex.allowLinksInCaptures is true).

    Limits: ≤ 10 patterns per rule, ≤ 200 characters each, {n} ≤ 100, ≤ 20 groups, ≤ 50 REGEX rules per account. Not supported by RE2: lookarounds (?=…) (?<=…), backreferences \1, atomic / possessive. Patterns use the digits 0–9 only, without tashkeel, tatweel or invisible characters. regex.ignoreCase and regex.normalizeArabic default to true. Messages longer than 4,096 characters are not checked against REGEX rules.

    Order: lower priority number first, then keyword > welcome > away; at the same priority REGEX rules are evaluated after EXACT / CONTAINS / STARTS_WITH rules.

    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. (changes settings)

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

    Path parameters

    Send this request for real?

    This changes your account settings.

    POST /v2/numbers/{numberId}/auto-replies