> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbit.devotel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshoot strict sender-ID mode rejects (SENDER_INVALID_FOR_DESTINATION)

> Decode every strict-mode rejection code Orbit returns on an alphanumeric sender — wrong_length_exact, restricted_prefix, leading_trailing_space, and the alpha-unsupported destinations — and fix or roll back in minutes.

# Troubleshoot strict sender-ID mode rejects

Strict sender-ID mode re-checks every outbound alphanumeric sender against
the destination country's format, prefix, and length rules **before the
send is submitted** and rejects a violation with
`422 SENDER_INVALID_FOR_DESTINATION`. This page decodes every rule code
the rejection can carry and shows the fix for each — read the code out of
the error's `details.rule` field before retrying, because a blind retry
re-burns the same code.

## Gate the control

The mode is an **opt-in, tenant-owned toggle** — it lives on the
`sms_sender_id_strict` key in your organization's settings and defaults to
off (permissive). Flip it via the dashboard sender-ID settings or through
support. Turning it on re-applies the full destination-country rule set
pre-send, so sends that used to pass with an advisory now fail closed.
That is the behavior you asked for — the page decodes which rule fired.

## Decode the rule code

A strict-mode rejection carries the violating rule in `details.rule`, the
destination country in `details.country`, the offending sender in
`details.sender`, and — for prefix violations — the matched prefix in
`details.matchedPrefix`.

| Rule code                   | Why it fired                                                                                                                                                                                     | Fix                                                                                      |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
| `wrong_length_exact`        | The country's hard length rule requires an exact character count — India (TRAI DLT) mandates **exactly 6 letters**                                                                               | Set the sender to the exact length (6 chars for IN), e.g. `MYBANK` instead of `MYBANK12` |
| `restricted_prefix`         | The sender starts with a government/bank reserved prefix — Turkey (BTK) blocks `GOV`, `BANK`, `SGK`, `MEB`; KSA blocks `GOV`, `MOH`, `STC`; UAE blocks `GOV`, `TRA`; India blocks `UIDAI`, `SBI` | Rename the sender to drop the reserved prefix; `details.matchedPrefix` names it          |
| `leading_trailing_space`    | The sender starts or ends with a space — carriers reject boundary whitespace                                                                                                                     | Trim the sender; internal spaces are fine (`MY BRAND`)                                   |
| `alpha_unsupported_country` | The destination's carriers do not support alphanumeric senders at all                                                                                                                            | Send from a phone number or short code for that destination                              |

Other codes in the format family — `too_long`, `too_short`,
`invalid_chars`, `wrong_alpha_only`, `wrong_numeric_only` — follow the
same pattern: the rejection names the country and the sender, so adjust
the sender value on the failing send path.

<Warning>
  SMS is billed when it is **submitted to the network**, not on delivery,
  and a carrier reject is not refunded. In permissive mode the same
  violating send is accepted and the wallet is charged — the pre-send
  422 exists to stop that spend.
</Warning>

## Incoming state: mode off vs mode on

|                                       | Permissive (default)                                                                                                | Strict (opted in)                                                                                 |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| Conforming sender                     | Accepted, no advisory                                                                                               | Accepted                                                                                          |
| Format/prefix/length violation        | Accepted; a `sender_deliverability_advisory` rides on the message metadata (`sender_format_nonconforming`, warning) | `422 SENDER_INVALID_FOR_DESTINATION` with `details.rule`                                          |
| Alpha-unsupported destination (US/CA) | Accepted; critical advisory `alpha_undeliverable_us_ca`                                                             | `400 VALIDATION_ERROR` — alphanumeric senders are not supported for US/Canada; use a phone number |
| Alpha-unsupported destination (other) | Accepted; warning advisory `alpha_unsupported_country`                                                              | `400` validation error — use a phone number                                                       |

Permissive advisories are informational only; strict mode blocks before
any wallet deduction.

## Revert the mode

Disable the mode the same way you enabled it — clear the
`sms_sender_id_strict` key on your organization settings (dashboard
sender-ID settings, or support). Permissive behavior resumes immediately:
non-conforming sends are accepted again and violations return as advisory
metadata. There is no migration or cooldown.

## Reproduce and fix each code

A violating request in strict mode hits the 422 on the same endpoint you
sent to. The examples below assume strict mode is on.

### `wrong_length_exact` — an 8-character sender to India

```bash theme={null}
curl -X POST https://api.orbit.devotel.io/api/v1/messages/sms \
  -H "Authorization: Bearer $ORBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "from": "MYBRAND1",
    "body": "Your order shipped"
  }'
```

```json theme={null}
{
  "error": {
    "code": "SENDER_INVALID_FOR_DESTINATION",
    "status": 422,
    "message": "Sender ID 'MYBRAND1' must be exactly 6 characters for India (TRAI DLT).",
    "details": { "country": "IN", "sender": "MYBRAND1", "rule": "wrong_length_exact" }
  }
}
```

Fix: set `from` to a 6-character alphabetic header, for example
`MYBRND`, or route the destination through a sender pool whose members
conform — see [sender pools](/guides/sender-pools).

### `restricted_prefix` — a `BANK*` sender to Turkey

```bash theme={null}
curl -X POST https://api.orbit.devotel.io/api/v1/messages/sms \
  -H "Authorization: Bearer $ORBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+905551234567",
    "from": "BANKNOW",
    "body": "Your order shipped"
  }'
```

```json theme={null}
{
  "error": {
    "code": "SENDER_INVALID_FOR_DESTINATION",
    "status": 422,
    "message": "Sender ID 'BANKNOW' starts with a restricted prefix for Turkey (BTK).",
    "details": { "country": "TR", "sender": "BANKNOW", "rule": "restricted_prefix", "matchedPrefix": "BANK" }
  }
}
```

Fix: rename the sender to drop the reserved prefix (`NOWBANK` passes;
the check matches the **start** of the sender). If the brand genuinely
needs the prefix, register it through the country's regulator channel —
see [sender-ID registration](/compliance/sender-id-registration).

### `leading_trailing_space` — whitespace at the boundary

```json theme={null}
{
  "error": {
    "code": "SENDER_INVALID_FOR_DESTINATION",
    "status": 422,
    "message": "Sender ID 'MYBRAND ' has leading or trailing whitespace.",
    "details": { "country": "DE", "sender": "MYBRAND ", "rule": "leading_trailing_space" }
  }
}
```

Fix: trim the sender before sending — internal spaces are fine, boundary
spaces are not.

### Alpha-unsupported destination

For US/Canada recipients, strict mode raises a `400` instead:

```json theme={null}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "status": 400,
    "message": "Alphanumeric sender IDs are not supported for US/Canada destinations. Use a phone number instead."
  }
}
```

Fix: send US/CA traffic from a phone number or short code; the implicit
fallback without strict mode swaps to a platform number, but explicit is
safer — see [sender resolution](/concepts/sender-resolution).

## Lens+: this is a tenant-owned control

Like suppression and opt-out gating, the sender-ID rule set is a control
**you own** — Orbit does not mandate it (see
[Compliance posture FAQ](/compliance/posture-faq)). Enabling strict mode
trades a permissive accept against a pre-send reject; disabling it
trades back. Neither choice changes what carriers enforce — it only
moves the reject from the carrier's DLR back to your API response.

## Related references

* [Sender-ID Registration](/compliance/sender-id-registration) — register
  a sender per country so registration gates also pass.
* [Sender resolution](/concepts/sender-resolution) — the full precedence
  chain from request selector to fallback.
* [Sender pools](/guides/sender-pools) — route destinations through pools
  whose members conform per country.
* [Error codes](/reference/error-codes) — the full send-path error table.
* [Compliance posture FAQ](/compliance/posture-faq) — the map of every
  tenant-owned toggle.
