50504: Programmable Chat: Message body parameter is too long
CHAT
ERROR
This error occurs when you create or update a Programmable Chat message with a Body that exceeds the allowed message size. Programmable Chat limits Message Body to 32 KiB.
- The
Bodyvalue in your message request is larger than the 32 KiB limit for a Chat message body. - Your application serializes structured data into
Body, which makes the message content too large. Twilio allows structured data inBodywhen you serialize it as a string, so oversized serialized payloads can trigger this error. - A pre-event webhook for
onMessageSendoronMessageUpdatemodifiesbodybefore the message is published and pushes it past the allowed limit.
- Reduce the
Bodyvalue so it stays within the 32 KiB message body limit. - Validate message length in your application before you create or update a message.
- If you use pre-event webhooks, review your
onMessageSendandonMessageUpdatelogic and make sure the returnedbodydoes not exceed the message size limit. - Keep
Bodyfocused on message text. If you send structured data inBody, reduce the serialized payload so it fits within the limit.