Search code examples
resourcestwiliomediammspurge

Twilio: Purging media resources older than a certain time automatically


Everytime we send an image MMS with Twilio, they keep a copy of the image on their server.

Does Twilio have a API function or an account setting to delete image resources older than a certain time (rather than deleting them one by one with the Delete Media Resource API)?

Thanks!


Solution

  • Twilio developer evangelist here.

    There is no account setting to delete images automatically, based on time or anything else. As the documentation says (emphasis mine):

    Twilio will keep that media around until you issue an HTTP DELETE on that instance.

    Every time you send a message you could schedule a job to run in the future to then delete that message's media. That way you are in control of deletion when you want it to happen.