sent-routing-strategist

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sent Routing Strategist

Sent路由策略指南

Routing is where the most expensive Sent misconceptions live. Two facts govern almost every decision:
  1. The
    channel
    array is a broadcast list, not a preference order.
    ["whatsapp", "sms"]
    with two recipients creates four messages and four charges. There is no
    fallback
    field and no ordered-preference syntax.
  2. Automatic routing is the fallback mechanism. Omit
    channel
    , or send
    ["sent"]
    , and the platform selects a route, then reroutes across up to three distinct channel-and-provider pairs when a route-level failure occurs.
路由是Sent平台最容易产生昂贵误解的环节。几乎所有决策都遵循两个核心事实:
  1. channel
    数组是广播列表,而非优先级顺序
    。若传入
    ["whatsapp", "sms"]
    且有两位收件人,会生成四条消息并产生四笔费用。平台不存在
    fallback
    字段,也没有优先级语法。
  2. 自动路由是默认的回退机制。省略
    channel
    字段,或传入
    ["sent"]
    ,平台会自动选择路由;当某一路由失败时,会在最多三组不同的通道-服务商组合间进行重路由。

Decide the channel value

确定channel取值

IntentCorrect valueReason
Reach the recipient however works bestomit
channel
or
["sent"]
Enables route selection and reroute
Guarantee one specific channel
["sms"]
,
["whatsapp"]
, or
["rcs"]
Pinning restricts matching to that channel and never crosses channels
Deliberately deliver the same content on several channels
["whatsapp", "sms"]
Broadcast; expect one message and one charge per pair
"Try RCS, fall back to SMS"omit
channel
or
["sent"]
An ordered array would broadcast; automatic routing performs the fallback
Any value outside
sent
,
sms
,
whatsapp
, and
rcs
returns
400
. When a user asks for ordered fallback, name the misconception explicitly before writing code, because the failure mode is duplicate delivery and duplicate cost rather than an error.
意图正确取值原因
以最优方式触达收件人省略
channel
或传入
["sent"]
启用路由选择与重路由功能
确保使用特定单一通道
["sms"]
["whatsapp"]
["rcs"]
固定通道会限制仅匹配该通道,绝不会跨通道路由
有意在多个通道发送相同内容
["whatsapp", "sms"]
广播模式;每个通道-收件人对应一条消息及一笔费用
"尝试RCS,失败则回退到SMS"省略
channel
或传入
["sent"]
有序数组会触发广播;自动路由可实现回退逻辑
sent
sms
whatsapp
rcs
之外的任何取值都会返回
400
错误。当用户要求按顺序回退时,需先明确指出这一误解,再编写代码——因为这种错误模式会导致重复送达和重复收费,而非直接抛出错误。

What a pinned channel gives up

固定通道的局限性

Pinning restricts route matching to the named channel. Rules without a channel constraint still match and resolve to the pinned channel, so pinning does not require channel-specific rules to exist. A pinned send never crosses to a different channel, though same-channel provider hops remain possible when a rule permits them. If no route exists on the pinned channel, the message ends
FAILED
with no route matched — it does not silently fall back.
Pin when a compliance, contractual, or content constraint requires a specific channel. Otherwise prefer automatic routing.
固定通道会将路由匹配限制为指定通道。即使没有通道约束的规则,仍会匹配并解析为固定通道,因此固定通道无需依赖特定通道规则。固定发送绝不会切换到其他通道,但在规则允许的情况下,同一通道内的服务商切换仍是可行的。若固定通道上不存在可用路由,消息会以
FAILED
状态结束,提示“无匹配路由”——不会自动静默回退到其他通道。
仅当合规要求、合同约束或内容限制需要特定通道时,才使用固定通道;否则优先选择自动路由。

Reading the outcome

解读执行结果

POST /v3/messages
returns
202
with per-recipient
message_id
values. For automatic routing, the echoed per-recipient channel is not a resolved route and is never updated afterward. Resolve the truth from evidence:
QuestionEvidence
Which route was actually attempted
message.routed
event, or
channel
on
GET /v3/messages/{id}
after routing
Did the recipient's device receive it
message.delivered
What sequence of routes was tried
GET /v3/messages/{id}/activities
Why did it stopTerminal status plus channel value
POST /v3/messages
接口会返回
202
状态码,同时返回每个收件人的
message_id
。对于自动路由,返回的收件人通道信息并非最终解析的路由,且后续不会更新。需通过以下证据获取真实情况:
问题证据来源
实际尝试了哪条路由
message.routed
事件,或路由完成后调用
GET /v3/messages/{id}
接口返回的
channel
字段
收件人设备是否收到消息
message.delivered
事件
尝试了哪些路由序列调用
GET /v3/messages/{id}/activities
接口
为何停止路由最终状态及channel取值

Terminal status interpretation

最终状态解读

StatusMeaningCorrect response
FAILED
A route attempt failed; automatic routing may still enqueue another attemptInspect the latest message state and activities before treating it as final
FILTERED
Policy gate — consent block or route denialNever retry; a consent block is a compliance stop
BLOCKED
Account precondition — balance, onboarding quota, unapproved templateFix the account condition, then send again
SCHEDULED
Parked by quiet-hours policyWait; it re-enters the pipeline automatically
An outcome whose
channel
is
auto
means the message ended before any route was attempted. The causes are no matching route, invalid template parameters, a consent block, or an account precondition. Account preconditions do not reject the send request: it is accepted with
202
and the affected messages surface as
BLOCKED
.
Sent records internal send-time reason codes on the message for these cases, but does not return them in API responses or webhooks, so diagnosis relies on the status-and-channel combination plus the activity history. The mapping from observable evidence to root cause is tabulated in references/routing-diagnosis.md.
状态含义正确处理方式
FAILED
路由尝试失败;自动路由可能仍会排队进行下一次尝试在将其视为最终结果前,检查最新的消息状态和活动记录
FILTERED
策略拦截——consent阻止或路由拒绝切勿重试;consent阻止属于合规性拦截
BLOCKED
账户前置条件不满足——余额不足、上线配额限制、模板未通过审核修复账户问题后重新发送
SCHEDULED
受静默时段策略限制暂存等待即可;消息会自动重新进入处理流程
若结果中的
channel
auto
,表示消息在未尝试任何路由前就已结束。原因包括无匹配路由、模板参数无效、consent阻止或账户前置条件不满足。账户前置条件问题不会直接拒绝发送请求:请求会以
202
状态被接受,受影响的消息会显示为
BLOCKED
状态。
Sent平台会在消息中记录这些情况的内部发送时原因码,但不会在API响应或Webhook中返回,因此诊断需依赖状态-通道组合及活动历史记录。可观测证据与根因的映射关系详见references/routing-diagnosis.md

Reroute behavior

重路由行为

A failed route is retried only when the terminal failure signals a route or carrier problem another route might overcome: undeliverable by this route, provider service unavailable, provider timeout, or transport error. Every other failure stays
FAILED
.
Reroute reuses the same
message_id
and re-runs the pipeline, so
message.queued
and
message.routed
fire again, consent gates re-apply on every attempt, and already-attempted routes are excluded. The ceiling is three distinct channel-and-provider pairs across the initial send and all reroutes.
The WhatsApp-to-SMS behavior customers ask about is a specific case of this: a WhatsApp message accepted and then failed for a recipient-side reason reroutes and records a recipient-scoped rule that WhatsApp is not deliverable for that number, so subsequent automatic sends skip WhatsApp for that recipient. It requires automatic routing; a pinned WhatsApp send cannot produce it.
仅当最终失败信号表明该路由或运营商存在其他路由可解决的问题时,才会重试失败的路由:如该路由无法送达、服务商服务不可用、服务商超时或传输错误。其他所有失败都会保持
FAILED
状态。
重路由会复用**同一个
message_id
**并重新运行流程,因此
message.queued
message.routed
事件会再次触发,每次尝试都会重新应用consent校验,且已尝试过的路由会被排除。初始发送及所有重路由的通道-服务商组合上限为三组。
客户常询问的WhatsApp转SMS行为是重路由的特定场景:若某条WhatsApp消息已被接受,但因收件人端原因失败,平台会进行重路由,并记录针对该收件人的规则——该号码无法通过WhatsApp送达,因此后续自动发送会跳过WhatsApp。此功能仅在自动路由模式下生效;固定WhatsApp发送无法实现该逻辑。

How automatic routing selects a route

自动路由的路由选择逻辑

Routes come from platform-maintained rules evaluated at send time against recipient attributes (country, number prefix, exact number, carrier, number type, ported state), sender, template attributes, channel, and whether the destination is international. Ordering is: exact-recipient rules first, then account-scoped before global, then match specificity, then rule priority, then longer number prefix, then the older rule. Inactive, deleted, expired, and below-threshold rules are excluded. Candidates whose template has an explicit non-approved review status on that channel are dropped, while a channel with no recorded review is not blocked. The first surviving candidate wins and the rest remain available as fallback routes.
There is no fixed channel preference order, so never promise "RCS first, then WhatsApp, then SMS." Read references/routing-model.md before making any claim about why a specific route was chosen.
路由来自平台维护的规则,发送时会根据收件人属性(国家、号码前缀、精确号码、运营商、号码类型、转网状态)、发件人、模板属性、通道以及目的地是否为国际地址进行评估。规则优先级顺序为:精确收件人规则优先,其次是账户级规则优于全局规则,然后是匹配特异性、规则优先级、更长号码前缀,最后是创建时间更早的规则。无效、已删除、过期及阈值以下的规则会被排除。若模板在某通道上有明确的未通过审核状态,该候选路由会被剔除;而无审核记录的通道不会被阻止。第一个符合条件的候选路由会被选中,其余候选路由则作为备用回退路由。
平台不存在固定的通道偏好顺序,因此切勿承诺“优先RCS,其次WhatsApp,最后SMS”。在作出任何关于路由选择原因的声明前,请阅读references/routing-model.md

Cost and volume consequences

成本与数量影响

Because broadcast multiplies messages by recipients, review any multi-channel array against expected spend before sending. A 1,000-recipient send with two channels is 2,000 messages. The per-request recipient ceiling is 1,000, and documented pacing pairs full batches with roughly one request per second to stay inside the 200-requests-per-minute budget.
RCS today carries text plus up to four suggestion chips, mapped from template buttons, and every outbound RCS message receives an appended STOP chip. Do not design an RCS-pinned flow that depends on rich cards, carousels, or media.
由于广播模式会将消息数量乘以收件人数,发送前需核对多通道数组对应的预期费用。若发送给1000位收件人且使用两个通道,会生成2000条消息。单请求的收件人上限为1000,文档建议每秒发送约一个完整批次,以保持在每分钟200请求的限额内。
当前RCS支持文本内容及最多四个由模板按钮映射而来的建议芯片,且每条outbound RCS消息都会自动附加STOP芯片。请勿设计依赖富卡片、轮播或媒体内容的固定RCS流程。

Boundaries

边界说明

Use
sent-messaging
to execute a single send with confirmation,
sent-two-way-messaging
for consent and inbound keyword semantics,
messaging-performance-analyzer
for aggregate delivery-rate regressions, and
sent-webhook-engineer
for receiving and deduplicating the events this skill teaches you to read.
如需执行单次带确认的发送,请使用
sent-messaging
;如需处理consent和入站关键字语义,请使用
sent-two-way-messaging
;如需分析整体送达率的回归问题,请使用
messaging-performance-analyzer
;如需接收并去重本技能所讲解的事件,请使用
sent-webhook-engineer