---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/50509#article
headline: "50509: Programmable Chat: Media message body cannot be updated"
url: https://www.twilio.com/docs/api/errors/50509
inLanguage: en
dateModified: 2026-06-08T11:38:30.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 50509: Programmable Chat: Media message body cannot be updated

Log Level: ERROR

## Description

This error occurs when you try to update the `Body` of a media message in Programmable Chat. Media messages store the attachment separately from the message record, do not support a per-message text body, and use a service-defined placeholder body for legacy clients.

### Possible causes

* You sent an update request with the `Body` parameter for a message whose `type` is `media`.
* The message was created with an attached media object, such as a `MediaSid`, and your application later tried to edit it like a text-only message.
* Your application uses the same update logic for both text messages and media messages without checking the message type first.

### Possible solutions

* Do not update `Body` on media messages. Update only supported non-body fields, such as `Attributes`, when you need to change message metadata.
* Check the message `type` before updating it. Only send `Body` updates for text messages.
* If you need to include text with an attachment, send a separate text message in the channel instead of trying to edit the media message body.
* If the media message was created incorrectly, delete the message and create a new one with the correct attachment.
* When sending media over the REST API, upload the file first and create the message with `MediaSid` instead of creating a media message and then attempting to rewrite its body.

#### Additional resources

* [Programmable Chat Message Resource](/docs/chat/rest/message-resource)
* [Media Support](/docs/chat/media-support)
