You can delete individual records of messages or media associated with messages by using the HTTP DELETE functionality of the API.
To delete individual message records through the API, use the HTTP DELETE functionality of the message resource.
To delete individual media files associated with MMS messages through the API, use the HTTP DELETE functionality of the message media resource. Once the media is deleted you will no longer be billed for its storage.
Note: deleting the record of a message does not automatically delete the media associated with the message (if applicable). If you need to delete a message and its associated media you’ll need to delete both the message and media records separately.
If you want to delete the message body but preserve the message record, you can use the HTTP POST functionality of the message resource. This will update the message body to be "" while the other message resource properties will remain intact.
An even better option would be to get Message Body Redaction enabled for your account, which allows you to redact the message bodies before they’re stored in long-term storage. Request access and pricing information by filling out this form.