auto_chunk_long_messages flag on a messaging profile. When disabled (the default), messages that exceed the segment limit are rejected with error 40302.
SMS chunking applies to SMS only. MMS and RCS messages are not affected.
Why use SMS chunking
Most carriers reject concatenated SMS beyond 10 segments — 1,530 GSM-7 characters or 670 UCS-2 characters. Some aggregator routes accept longer messages, up to 25 segments. By default, a message that exceeds the limit for its destination is rejected with error40302:
How it works
Whenauto_chunk_long_messages is enabled on the messaging profile:
- Telnyx counts the segments of the encoded body and the maximum segments allowed for the destination route (10 by default; some aggregator routes accept up to 25).
- If the message exceeds the limit, the body is split into chunks at segment boundaries — never inside a multi-byte character or a GSM-7 escape sequence — so every chunk renders correctly. The message encoding, including any per-request
encodingoverride, determines the split boundaries (153 characters per segment for GSM-7; 134 bytes, or 67 characters, per segment for UCS-2). - Each chunk becomes an independent SMS with its own message ID, segment count, and delivery receipt. Standard concatenation still applies within a chunk.
- Chunks are sent sequentially: the next chunk is dispatched once the upstream gateway accepts the previous one (the
message.sentstage), without waiting for its delivery receipt. - All chunks of one request share the same sender and route.
Chunks are dispatched as soon as the previous one is accepted by the upstream gateway, without per-message rate pacing between chunks. Rate limits still apply to the initial send.
message.sent or message.finalized webhooks.
A delivery failure reported after a chunk is accepted does not stop the group: the next chunk has already been dispatched, so later chunks can still be delivered even if an earlier chunk’s message.finalized reports a failure. A chunk whose delivery receipt never arrives also does not block the chunks after it.
Enable SMS chunking
Setauto_chunk_long_messages under features on a messaging profile with the Update a Messaging Profile endpoint (or when creating a profile):
Set
auto_chunk_long_messages as a JSON boolean. The API also accepts 1/0 and the strings "true"/"false"/"1"/"0" (case-insensitive); any other value, such as "yes", is rejected with a validation error. Setting the flag preserves the other keys in the features object.Chunk responses and webhooks
The API response to a chunked send is the first chunk. It carries the first chunk’stext slice and parts count (within the destination limit), and child_message_id pointing at the next chunk. Its own parent_message_id is null — the first chunk’s id is the original request’s ID:
message.sent / message.finalized webhooks, and the message detail record (Retrieve a Message) — returned as null when not applicable:
The first chunk’s
id is the message ID of the original request, so parent_message_id groups every chunk back to the same request. Use it for billing analysis, detail records, and grouping delivery receipts per original request.
message.finalized webhook for the last chunk (abridged to the fields relevant to chunking):
Each chunk’s response and webhooks carry that chunk’s own text slice, not the full original body.
Chunk webhooks may arrive out of order: the next chunk is dispatched as soon as the previous one is accepted, so its webhook can arrive before the previous chunk’s
message.finalized. Correlate by parent_message_id and the chunk’s id rather than arrival order.Billing
Each chunk is billed as its own message based on its own segment count.Limitations
- SMS only — MMS and RCS are not chunked.
- Messaging-profile scope — chunking is enabled per profile; there is no per-request parameter.
- Per-chunk ceiling — each chunk holds at most the destination’s segment ceiling (10 segments, or 25 on some aggregator routes), so a body is split into as many chunks as needed. For example, a 21-segment body on a 10-segment route is sent as three chunks.
Related resources
Message Encoding
Segment math for GSM-7, UCS-2, and concatenated SMS.
Smart Encoding
Reduce segment counts by substituting Unicode characters with GSM-7 equivalents.
Error Codes
Reference for error
40302 and other messaging errors.Messaging Profiles API
API reference for updating messaging profile features.