---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/50504#article
headline: "50504: Programmable Chat: Message body parameter is too long"
url: https://www.twilio.com/docs/api/errors/50504
inLanguage: en
dateModified: 2026-06-08T11:29:20.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 50504: Programmable Chat: Message body parameter is too long

Log Type: APPLICATION

Log Level: ERROR

## Description

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.

### Possible causes

* The `Body` value 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 in `Body` when you serialize it as a string, so oversized serialized payloads can trigger this error.
* A pre-event webhook for `onMessageSend` or `onMessageUpdate` modifies `body` before the message is published and pushes it past the allowed limit.

### Possible solutions

* Reduce the `Body` value 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 `onMessageSend` and `onMessageUpdate` logic and make sure the returned `body` does not exceed the message size limit.
* Keep `Body` focused on message text. If you send structured data in `Body`, reduce the serialized payload so it fits within the limit.

#### Additional resources

* [Chat Limits](/docs/chat/chat-limits)
* [Webhook Events](/docs/chat/webhook-events)
* [Programmable Chat Message Resource](/docs/chat/rest/message-resource)
