sent-routing-strategist
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSent Routing Strategist
Sent路由策略指南
Routing is where the most expensive Sent misconceptions live. Two facts govern almost every decision:
- The array is a broadcast list, not a preference order.
channelwith two recipients creates four messages and four charges. There is no["whatsapp", "sms"]field and no ordered-preference syntax.fallback - Automatic routing is the fallback mechanism. Omit , or send
channel, and the platform selects a route, then reroutes across up to three distinct channel-and-provider pairs when a route-level failure occurs.["sent"]
路由是Sent平台最容易产生昂贵误解的环节。几乎所有决策都遵循两个核心事实:
- 数组是广播列表,而非优先级顺序。若传入
channel且有两位收件人,会生成四条消息并产生四笔费用。平台不存在["whatsapp", "sms"]字段,也没有优先级语法。fallback - 自动路由是默认的回退机制。省略字段,或传入
channel,平台会自动选择路由;当某一路由失败时,会在最多三组不同的通道-服务商组合间进行重路由。["sent"]
Decide the channel value
确定channel取值
| Intent | Correct value | Reason |
|---|---|---|
| Reach the recipient however works best | omit | Enables route selection and reroute |
| Guarantee one specific channel | | Pinning restricts matching to that channel and never crosses channels |
| Deliberately deliver the same content on several channels | | Broadcast; expect one message and one charge per pair |
| "Try RCS, fall back to SMS" | omit | An ordered array would broadcast; automatic routing performs the fallback |
Any value outside , , , and returns . 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.
sentsmswhatsapprcs400| 意图 | 正确取值 | 原因 |
|---|---|---|
| 以最优方式触达收件人 | 省略 | 启用路由选择与重路由功能 |
| 确保使用特定单一通道 | | 固定通道会限制仅匹配该通道,绝不会跨通道路由 |
| 有意在多个通道发送相同内容 | | 广播模式;每个通道-收件人对应一条消息及一笔费用 |
| "尝试RCS,失败则回退到SMS" | 省略 | 有序数组会触发广播;自动路由可实现回退逻辑 |
除、、和之外的任何取值都会返回错误。当用户要求按顺序回退时,需先明确指出这一误解,再编写代码——因为这种错误模式会导致重复送达和重复收费,而非直接抛出错误。
sentsmswhatsapprcs400What 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 with no route matched — it does not silently fall back.
FAILEDPin when a compliance, contractual, or content constraint requires a specific channel. Otherwise prefer automatic routing.
固定通道会将路由匹配限制为指定通道。即使没有通道约束的规则,仍会匹配并解析为固定通道,因此固定通道无需依赖特定通道规则。固定发送绝不会切换到其他通道,但在规则允许的情况下,同一通道内的服务商切换仍是可行的。若固定通道上不存在可用路由,消息会以状态结束,提示“无匹配路由”——不会自动静默回退到其他通道。
FAILED仅当合规要求、合同约束或内容限制需要特定通道时,才使用固定通道;否则优先选择自动路由。
Reading the outcome
解读执行结果
POST /v3/messages202message_id| Question | Evidence |
|---|---|
| Which route was actually attempted | |
| Did the recipient's device receive it | |
| What sequence of routes was tried | |
| Why did it stop | Terminal status plus channel value |
POST /v3/messages202message_id| 问题 | 证据来源 |
|---|---|
| 实际尝试了哪条路由 | |
| 收件人设备是否收到消息 | |
| 尝试了哪些路由序列 | 调用 |
| 为何停止路由 | 最终状态及channel取值 |
Terminal status interpretation
最终状态解读
| Status | Meaning | Correct response |
|---|---|---|
| A route attempt failed; automatic routing may still enqueue another attempt | Inspect the latest message state and activities before treating it as final |
| Policy gate — consent block or route denial | Never retry; a consent block is a compliance stop |
| Account precondition — balance, onboarding quota, unapproved template | Fix the account condition, then send again |
| Parked by quiet-hours policy | Wait; it re-enters the pipeline automatically |
An outcome whose is 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 and the affected messages surface as .
channelauto202BLOCKEDSent 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.
| 状态 | 含义 | 正确处理方式 |
|---|---|---|
| 路由尝试失败;自动路由可能仍会排队进行下一次尝试 | 在将其视为最终结果前,检查最新的消息状态和活动记录 |
| 策略拦截——consent阻止或路由拒绝 | 切勿重试;consent阻止属于合规性拦截 |
| 账户前置条件不满足——余额不足、上线配额限制、模板未通过审核 | 修复账户问题后重新发送 |
| 受静默时段策略限制暂存 | 等待即可;消息会自动重新进入处理流程 |
若结果中的为,表示消息在未尝试任何路由前就已结束。原因包括无匹配路由、模板参数无效、consent阻止或账户前置条件不满足。账户前置条件问题不会直接拒绝发送请求:请求会以状态被接受,受影响的消息会显示为状态。
channelauto202BLOCKEDSent平台会在消息中记录这些情况的内部发送时原因码,但不会在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 .
FAILEDReroute reuses the same and re-runs the pipeline, so and 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.
message_idmessage.queuedmessage.routedThe 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重路由会复用**同一个**并重新运行流程,因此和事件会再次触发,每次尝试都会重新应用consent校验,且已尝试过的路由会被排除。初始发送及所有重路由的通道-服务商组合上限为三组。
message_idmessage.queuedmessage.routed客户常询问的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 to execute a single send with confirmation, for consent and inbound keyword semantics, for aggregate delivery-rate regressions, and for receiving and deduplicating the events this skill teaches you to read.
sent-messagingsent-two-way-messagingmessaging-performance-analyzersent-webhook-engineer如需执行单次带确认的发送,请使用;如需处理consent和入站关键字语义,请使用;如需分析整体送达率的回归问题,请使用;如需接收并去重本技能所讲解的事件,请使用。
sent-messagingsent-two-way-messagingmessaging-performance-analyzersent-webhook-engineer