Skip to content

Instantly share code, notes, and snippets.

@alexford
Created November 2, 2014 21:05
Show Gist options
  • Save alexford/545c59d69261f7ebb4ca to your computer and use it in GitHub Desktop.
Save alexford/545c59d69261f7ebb4ca to your computer and use it in GitHub Desktop.
A quick and dirty Ruby script to remove ALL call recordings from a Twilio account
require 'twilio-ruby' #twilio-ruby gem
account_sid = 'your account SID'
account_token = 'your account auth token'
@client = Twilio::REST::Client.new account_sid, account_token
recordings = @client.recordings.list
puts "Total recordings: #{recordings.total}"
recordings_remaining = recordings.total
while recordings_remaining > 0 do
@client.recordings.list.each do |rec|
rec.delete
print "."
end
recordings_remaining = @client.recordings.list.total
puts "#{recordings_remaining} recordings remaining"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment