match condition → destination pairs; every inbound (MO) SMS message is tested against them, and the first match claims it. Anything no rule claims falls through to the default delivery, so you can add rules incrementally without changing existing traffic.
This is the messaging analogue of inbound email routing: the same rule-engine shape you use on a parsed inbound domain, applied to SMS. Both surfaces sit behind the same permission tier — rules change where every inbound message in the tenant is delivered, so they are controlled by the owner and admin roles.
1. Where rules live
Open Messages → Settings → Inbound routes in the dashboard. The page lists every rule in evaluation order and shows the controls to create, edit, enable, disable, or delete one.
GET / POST / PATCH / DELETE /api/v1/messages/inbound-routes. Dashboard changes and API changes write to the same rule set; there is no separate “dashboard-only” copy.
2. Rule anatomy
Each rule has four fields that matter at evaluation time, plus metadata:Match types
Each rule matches on exactly one condition type:number— the receiving number (the DID the message arrived on), compared with normalized E.164 equality. Spaces and dashes collapse before the comparison, so+1 555 123 0000,+1-555-123-0000, and+15551230000are the same value.sender— the originating number, using the same normalized equality. Use this to route known contacts (a VIP customer’s handset, a driver pool’s numbers).keyword— a case-insensitive token found anywhere in the message body.HELPmatcheshelp,Help me, andI need help now. Good for vocabulary-driven triage.regex— a case-insensitive pattern on the message body. Patterns are validated when you save the rule; an invalid pattern is rejected with a422instead of silently never matching. Anchored patterns (^SUPPORT) stay fast; the pattern source is capped at 512 characters.
3. Destinations
A matched message goes to one destination:- Webhook — an HTTPS, publicly reachable URL on your own infrastructure. Optionally add a shared secret; every delivery is then signed with
X-Orbit-Signature: sha256=<hex>over the raw JSON body so your receiver can verify it. Pick a webhook when another system (a ticket bridge, a data warehouse, a custom processor) owns the follow-up. - Queue — a named inbound queue your team works from. Pick a queue when matched messages need triage discipline and handoff metrics rather than a general inbox.
- Inbox — the shared inbox, the same place unrouted messages land. Pick an inbox when routing is about filing, not staffing.
- Team — a specific team’s view. Pick a team when the match condition identifies ownership (French senders → the Paris team) rather than workload shape.
- Auto-reply — a templated message sent straight back to the sender. Pick this when the right response is deterministic and no external system is needed.
Auto-reply templates
An auto-reply rule carries a reply template intargetConfig.template. You can personalize it with these placeholders:
For example, a rule that matches keyword
HOURS with the template:
4. Priority ordering
Rules evaluate in ascending priority — the lowest number first — and the first match wins. Ties go to the older rule. When you create rules, leave gaps in the priority numbers (10, 20, 30) so you can insert a rule between two neighbors later without renumbering the list. Unmatched messages keep their default delivery (the shared inbox and your subscribed webhook events), exactly as if no rules existed. A rule never blocks delivery — the worst a bad rule does is claim a message it should not have, and you reverse that by disabling the rule.Worked renumbering
Imagine you start with three rules at priorities 10, 20, and 30:
Later you need a rule between the opt-out handler and the support bridge. Because you left gaps, you can add it at priority 15 without touching the others:
If you had started with 1, 2, 3, the new rule would have required renumbering. The dashboard lets you edit a rule’s priority directly; the list re-sorts as soon as the change is saved.
5. Dashboard walkthrough
Create a rule
- Click Create rule.
- Give the rule a name that reads well in an audit log later, such as
Support keyword → helpdesk. - Pick a match type and enter the value. If you chose
regex, the dashboard validates the pattern before you can save. - Pick a destination:
- Webhook: enter an HTTPS URL and, optionally, a signing secret.
- Queue / Inbox / Team: paste the destination ID.
- Auto-reply: write the reply template.
- Set a priority. Lower numbers evaluate first. Leave gaps for future rules.
- Save. The rule is enabled by default.

Edit a rule
Click the row actions menu on any rule and choose Edit. You can change the name, match condition, destination, priority, or description. The rule ID and creation time stay the same, so ties continue to resolve predictably.Disable or delete a rule
Use the toggle in the Status column to disable a rule without removing it. Disabled rules are skipped during evaluation, and you can re-enable them later. To remove a rule permanently, open the row actions menu and choose Delete. Deleting a rule cannot be undone, but inbound messages that matched it simply fall back to default delivery — they are not lost.
Verify a rule is firing
Send a matching inbound SMS to one of your numbers, then check the rule row in the dashboard. A successful match updates the Last matched at timestamp. If the destination is a webhook, a non-2xx response increments the Failures badge on the row, and Last failure at records when it last failed.6. Limits and error catalog
Limits
Regex DoS guard
Regex patterns are validated at save time, and the matcher caps the pattern source at 512 characters at evaluation time. A corrupt or overlong pattern does not stall the inbound hot path; it simply fails to match and is logged. Keep patterns anchored (^STATUS) and avoid nested quantifiers like (a+)+ that can backtrack catastrophically.
Error catalog
The dashboard surfaces these validation errors inline; the API returns them as422 responses:
Role errors: members and viewers receive
403 Forbidden on list, create, update, and delete calls.
7. Multi-channel behavior and interplay with keyword auto-replies
Inbound routing rules currently evaluate for SMS inbound messages. Other channels (WhatsApp, RCS, Viber) use the separate Settings → Auto-Reply Rules engine, which supports channel-specific keyword matching. On SMS, the two systems run alongside each other:- Built-in consent handling runs first. Standard opt-out and opt-in vocabulary (
STOP,START, and their multilingual equivalents) are recognized before any rule is consulted. Do not try to overrideSTOPwith a custom rule; the built-in handler claims it first. - Keyword auto-reply rules run next. These are the rules under Settings → Auto-Reply Rules and can send replies, record consent, forward to an agent, or trigger a flow.
- Inbound routing rules run in parallel. The inbound-routing engine evaluates its priority-ordered rule set and dispatches the first match to its destination.
HOURS could receive an auto-reply from the keyword-rules engine and also be forwarded to a webhook by an inbound route. If you only want one response, keep the routing rule and disable the overlapping keyword rule, or route the message to auto_reply in the inbound-routes engine instead of using the keyword-rules engine for that keyword.
8. Troubleshooting
A message was not claimed by any rule
- Check that the rule is enabled. Disabled rules are skipped.
- Check the match value.
numberandsendercompare normalized E.164 values, so spaces and dashes do not matter, but a leading+does.keywordmatches anywhere in the body and is case-insensitive.regexis case-insensitive and must be a valid pattern. - Check priority. A higher-priority rule (lower number) may be claiming the message first. The dashboard shows evaluation order; the first enabled match wins.
- Check the channel. Inbound routing rules evaluate for SMS. Messages from WhatsApp, RCS, or Viber are handled by keyword auto-reply rules instead.
Fallback behavior
When no rule matches, the inbound SMS follows the default path: it opens or threads onto a conversation in the shared inbox and fans out to any subscribed webhook events (message.received). Rules never drop an inbound message; they only change where it is delivered.
If a webhook destination fails repeatedly, the rule’s Failures badge increments, but the message itself is still ingested and available in the inbox and delivery log.
Webhook signature verification failure
Webhook targets receive a signed POST when a secret is configured:- Reading a parsed body instead of raw bytes. Re-serializing JSON changes whitespace and breaks the signature. Read the raw request bytes before parsing.
- Using the masked secret from a list response. Secrets are masked as
••••in list and get responses. Store the cleartext secret when you create the rule. - Comparing the wrong header. Inbound route webhooks use
X-Orbit-Signature: sha256=<hex>, not thet=...,v1=...format used by tenant webhook subscriptions. - A secret mismatch. If you rotate the secret by editing the rule, deliveries from that point forward use the new key.
9. API surface
The rules engine is exposed underGET/POST/PATCH/DELETE /api/v1/messages/inbound-routes. This guide intentionally does not re-document every field — the API reference is the source of truth for request and response shapes, and the dashboard’s rule form maps one-to-one onto those fields (matchType, matchValue, targetType, targetConfig, priority, enabled).
A minimal create request looks like:
See also
- Route inbound SMS with priority-ordered rules — the full field inventory and cURL walkthrough for this surface
- Inbound email routing — the email analogue of the same rule engine
- Inbound number routing — the per-DID choice a message rule stacks underneath
- Keyword auto-reply rules — the keyword engine that runs alongside inbound routes on SMS
- Opt-out lists — the consent records your opt-out queue processes
- Webhook security — how to verify HMAC-SHA256 signatures