# Inbound Message Filtering Inbound SMS messages can be filtered before they reach you. Every message that arrives for one of your numbers is checked against any filter rules that apply to it, and messages that match a blocking rule are rejected before they reach your message history or your webhook. This is useful for cutting out spam, unwanted marketing traffic, or any other messages you would rather never see. ## What filters can match on A filter rule can match on: - **The sender** — either a phone number or an alphanumeric sender ID (e.g. a brand name). - **The message body** — the text content of the message. - **Both** — a rule may combine a sender condition and a body condition; both must match for the rule to apply. Matches can be simple text matches or patterns (regular expressions), so a rule can be as precise ("exactly this sender") or as broad ("any message starting with this text") as you need. ## Filter scope Filters can be applied at three levels: - **Number-specific** — applies to a single one of your numbers. - **Account-wide** — applies to all numbers on your account. - **System-wide** — applied by us across the platform, for example to block known spam sources for all customers. More specific rules always take precedence: a rule on an individual number is evaluated before an account-wide rule, and your account's rules are evaluated before system-wide ones. ## Blocking and allowing A rule either **blocks** matching messages or explicitly **allows** them. An allow rule acts as an exception: because it is evaluated first when it is more specific, it can protect messages from a broader blocking rule — for example, allowing one trusted sender through on a particular number while blocking that sender's traffic everywhere else. If no rule matches, the message is delivered as normal. Filtering is opt-in — nothing is blocked unless a rule says so. ## What happens to a blocked message When a message is blocked: - It is **not delivered** to your webhook, and it will not appear in your inbound message history or API results. - It is placed in a **quarantine area**, where it is held for **30 days** before being permanently deleted. If a filter catches something it shouldn't have, contact us within that window and we can retrieve the message and adjust the rule. - The delivery attempt is **rejected back to the carrier** — we do not acknowledge it as delivered. How the rejection is handled from there, including whether the original sender is notified, depends on the carrier and the sender's network. ## Setting up filters Filter rules are set up and managed by our support team — just contact us with what you would like blocked (or allowed) and at which level, and we will apply the rules for you. New rules and changes normally take effect within a few minutes.