Skip to content

Instantly share code, notes, and snippets.

@po5i
Forked from caseysoftware/delete-recordings.py
Last active April 9, 2018 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save po5i/c66b4fea92dd2f02780a035e1a132e45 to your computer and use it in GitHub Desktop.
Save po5i/c66b4fea92dd2f02780a035e1a132e45 to your computer and use it in GitHub Desktop.
This is a simple script using the Twilio Python module to retrieve Recordings within a certain date range and then delete them.
from datetime import date
from twilio.rest import Client
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)
recordings = client.recordings.list(date_created_after=date(2012, 1, 1))
for recording in recordings:
print("Deleting: " + recording.sid)
recording.delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment