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
namerequired
Typestring
Constraints≤ 120 chars
DescriptionRule name (≤ 120).
enabledoptional
Typeboolean
Constraintsdefault true
Descriptionfalse keeps the rule but stops it from answering.
triggerrequired
Typeobject
Constraints—
DescriptionWhen the rule answers.
trigger.typeoptional
Typestring
Constraintsone of: KEYWORD · FIRST_MESSAGE · AWAY
DescriptionKEYWORD (message contains / equals a keyword), FIRST_MESSAGE (welcome a new chat) or AWAY (outside the schedule).
DescriptionEXACT, 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.keywordsoptional
Typestring[]
Constraints≤ 50 items
DescriptionUp to 50 keywords for EXACT / CONTAINS / STARTS_WITH rules.
trigger.patternsoptional
Typestring[]
Constraints1–10 items
DescriptionREGEX 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}.
DescriptionKeep 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).
Besides the authentication, rate-limit and validation errors every endpoint can return:
403 · AUTO_REPLIES_NOT_IN_PLAN — Your plan does not include auto-replies.
Upgrade.
Correct the cause before repeating the request.
HTTP 403 · application/json
{
"error": {
"code": "AUTO_REPLIES_NOT_IN_PLAN",
"message": "Your plan does not include auto-replies.",
"docsUrl": "https://mursilat.com/developers/v2/errors#AUTO_REPLIES_NOT_IN_PLAN",
"requestId": "req_6604bedc8c489f20e582691a"
}
}
400 · AUTO_REPLY_PATTERNS_REQUIRED — Regular-expression rules need at least one pattern.
Add trigger.patterns (1–10 patterns).
Correct the cause before repeating the request.
HTTP 400 · application/json
{
"error": {
"code": "AUTO_REPLY_PATTERNS_REQUIRED",
"message": "Regular-expression rules need at least one pattern.",
"docsUrl": "https://mursilat.com/developers/v2/errors#AUTO_REPLY_PATTERNS_REQUIRED",
"requestId": "req_6604bedc8c489f20e582691a"
}
}
400 · AUTO_REPLY_REGEX_INVALID — A pattern is not a valid RE2 regular expression, uses a feature RE2 does not support (lookarounds, backreferences, atomic / possessive), contains non-ASCII digits, tashkeel / tatweel or invisible characters, exceeds the limits (200 chars, {n} ≤ 100, complexity) or matches an empty message.
details: patternIndex, reason, position (1-based) and messages {en, ar}. Fix that pattern; test it with POST /auto-replies/test.
Correct the cause before repeating the request.
HTTP 400 · application/json
{
"error": {
"code": "AUTO_REPLY_REGEX_INVALID",
"message": "A pattern is not a valid RE2 regular expression, uses a feature RE2 does not support (lookarounds, backreferences, atomic / possessive), contains non-ASCII digits, tashkeel / tatweel or invisible characters, exceeds the limits (200 chars, {n} ≤ 100, complexity) or matches an empty message.",
"docsUrl": "https://mursilat.com/developers/v2/errors#AUTO_REPLY_REGEX_INVALID",
"requestId": "req_6604bedc8c489f20e582691a"
}
}
400 · AUTO_REPLY_REGEX_TOO_MANY_PATTERNS — A rule can have at most 10 patterns.
Combine alternatives with | or split the rule.
Correct the cause before repeating the request.
HTTP 400 · application/json
{
"error": {
"code": "AUTO_REPLY_REGEX_TOO_MANY_PATTERNS",
"message": "A rule can have at most 10 patterns.",
"docsUrl": "https://mursilat.com/developers/v2/errors#AUTO_REPLY_REGEX_TOO_MANY_PATTERNS",
"requestId": "req_6604bedc8c489f20e582691a"
}
}
404 · NUMBER_NOT_FOUND — Number not found in this account.
Check numberId (GET /v2/numbers).
Correct the cause before repeating the request.
HTTP 404 · application/json
{
"error": {
"code": "NUMBER_NOT_FOUND",
"message": "Number not found in this account.",
"docsUrl": "https://mursilat.com/developers/v2/errors#NUMBER_NOT_FOUND",
"requestId": "req_6604bedc8c489f20e582691a"
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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.