# Update a message Use this endpoint for the [Media](./index.mdx) method to update a message body after it has been sent. Useful for removing sensitive information from the body after the message has been received. ## Parameters | Parameter | Description | | : | :- | | Body required | The new text with which to replace the body. | ## Examples ### Request: Update a Messages Body shell curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json \ -X POST \ --data-urlencode Body=Overridden \ -u YourProjectID:YourAuthToken javascript const { RestClient } = require(@signalwire/compatibility-api) const client = RestClient(YourProjectID, YourAuthToken, { signalwireSpaceUrl: example.signalwire.com }) client.messages(MessageSid) .update({body: Overridden}) .then(message => console.log(message.to)) .done(); csharp using System; using System.Collections.Generic; using Twilio; using Twilio.Rest.Api.V2010.Account; class Program { static void Main(string[] args) { TwilioClient.Init(YourProjectID, YourAuthToken, new Dictionary { [signalwireSpaceUrl] = {SPACE}.signalwire.com }); var message = MessageResource.Update( body: Overridden, ); Console.WriteLine(message.To); } } python from signalwire.rest import Client as signalwire_client client = signalwire_client(YourProjectID, YourAuthToken, signalwire_space_url = example.signalwire.com) message = client.messages(MessageSid) \ .update(body=Overridden) print(message.to) ruby require signalwire/sdk @client = Signalwire::REST::Client.new YourProjectID, YourAuthToken, signalwire_space_url: example.signalwire.com message = @client.messages(MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) .update(body: Overridden) puts message.to #### Responses 200 OK
json { api_version: 2010-04-01, body: Overridden, num_segments: 1, num_media: 0, date_created: Mon, 13 Aug 2018 23:08:35 +0000, date_sent: Mon, 13 Aug 2018 23:08:40 +0000, date_updated: Mon, 13 Aug 2018 23:08:45 +0000, direction: outbound-api, error_code: null, error_message: null, from: +15551234567, price: 0.005, price_unit: USD, status: delivered, to: +15557654321, uri: /api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/b3877c40-da60-4998-90ad-b792e98472af, subresource_uris: { media: /api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/b3877c40-da60-4998-90ad-b792e98472af/Media } } ### Request: Redact a Message Redact a message body by posting an empty string as the body to a sent message. shell curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json \ -X POST \ --data-urlencode Body= \ -u YourProjectID:YourAuthToken javascript const { RestClient } = require(@signalwire/compatibility-api) const client = RestClient(YourProjectID, YourAuthToken, { signalwireSpaceUrl: example.signalwire.com }) client.messages(MessageSid) .update({body: }) .then((message) => process.stdout.write(message.body)); csharp using System; using System.Collections.Generic; using Twilio; using Twilio.Rest.Api.V2010.Account; class Program { static void Main(string[] args) { TwilioClient.Init(YourProjectID, YourAuthToken, new Dictionary { [signalwireSpaceUrl] = {SPACE}.signalwire.com }); const string sid = MessageSid; var message = MessageResource.Update(sid, ); Console.WriteLine(message.Body); } } python from signalwire.rest import Client as signalwire_client client = signalwire_client(YourProjectID, YourAuthToken, signalwire_space_url = example.signalwire.com) client.messages(MessageSid) \ .update(body=) ruby require signalwire/sdk @client = Signalwire::REST::Client.new YourProjectID, YourAuthToken, signalwire_space_url: example.signalwire.com @message = @client.api.messages(MessageSid).fetch @message.update(body: ) puts @message.body