Delete a message
Use this endpoint for the Media method to delete a message from your Project so it no longer appears in the Dashboard or on the API. Any Media files that may be associated with this message are not deleted, and will still be available for access in the usual methods.
Messages in progress may not be deleted, and attempting to do so results in an error.
Parameters
Parameter |
---|
No Parameters |
Request
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json \
-X DELETE \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.messages('MessageSid')
.remove()
.then(message => console.log(message.sid))
.done();
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<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
MessageResource.Delete(pathSid: "MessageSid");
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
client.messages('MessageSid').delete()
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
@client.messages('MessageSid').delete
Responses
204 NO CONTENT
A 204 No Content
response indicates that the Message was successfully deleted.