{"action":"closed","issue":{"url":"https://api.github.com/repos/twilio/twilio-node/issues/75","labels_url":"https://api.github.com/repos/twilio/twilio-node/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/twilio/twilio-node/issues/75/comments","events_url":"https://api.github.com/repos/twilio/twilio-node/issues/75/events","html_url":"https://github.com/twilio/twilio-node/issues/75","id":56869665,"number":75,"title":"media.delete() on a media instance returns 404","user":{"login":"cylinderStudio","id":4257657,"avatar_url":"https://avatars.githubusercontent.com/u/4257657?v=3","gravatar_id":"","url":"https://api.github.com/users/cylinderStudio","html_url":"https://github.com/cylinderStudio","followers_url":"https://api.github.com/users/cylinderStudio/followers","following_url":"https://api.github.com/users/cylinderStudio/following{/other_user}","gists_url":"https://api.github.com/users/cylinderStudio/gists{/gist_id}","starred_url":"https://api.github.com/users/cylinderStudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cylinderStudio/subscriptions","organizations_url":"https://api.github.com/users/cylinderStudio/orgs","repos_url":"https://api.github.com/users/cylinderStudio/repos","events_url":"https://api.github.com/users/cylinderStudio/events{/privacy}","received_events_url":"https://api.github.com/users/cylinderStudio/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-06T21:20:59Z","updated_at":"2015-02-11T17:12:15Z","closed_at":"2015-02-11T17:12:15Z","body":"When I create and send an MMS, I call a function in a separate fallback application using the statusCallback property. I'm trying to use that function to check for smsStatus of 'sent' and then delete any media instances that were created for a message from Twilio's servers.\r\n\r\nI can get as far as actually listing the media instances, but attempting to delete them is a problem. I actually get a media list with media instances in the array, and the console.log statement in the if(err) block shows a value for mediaElement.sid, but the second console.log statement there shows err.status of 404.\r\n\r\n```\r\nif (req.body.SmsStatus === 'sent') {\r\n\t\ttwilio_client.messages(req.body.MessageSid).media.list(function(err, data) {\r\n\t\t\tif (data.media_list.length > 0) {\r\n\t\t\t\tdata.media_list.forEach(function(mediaElement) {\r\n\t\t    \ttwilio_client.messages(req.body.MessageSid).media(mediaElement.sid).delete(function(err, data) {\r\n\t\t    \t\tif (err) {\r\n\t\t\t\t      console.log('Unable to delete Twilio media instance: ' + mediaElement.sid);\r\n\t\t\t\t      console.log('Error status: ' + err.status);\r\n\t\t\t\t    } else {\r\n\t\t\t\t      console.log('Twilio media instance ' + mediaElement.sid + ' deleted successfully.');\r\n\t\t\t\t    }\r\n\t\t    \t});\r\n\t\t    });\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n```"}}