In this tutorial, you will learn how to get a list call recordings by duration. This is useful if you have a lot of calls that are very short(< 30 seconds) and can be deleted. The content covered in this tutorial can help you when generating reports in order to remove calls that have little or no significance to the report or if you wish to remove call recordings in order to save money on call archives.

The Call Recording API allows you to retrieve all call recordings and allows for filtering by call date, extension, caller_id, direction(inbound or outbound) and more. Please have a look at the api reference to view all the possible filters.

In this example, you will query for the last month of recordings and delete calls that are less than 30 seconds in length. You will use a python script to query for the call recordings and then you will delete each of the recordings.

Python is the language used to build the following example; however, you can use any language with which you are most comfortable. The following uses a external library called Requests. You will need to install the Requests library using pip. In your terminal, type:

pip install requests

Delete company call recordings by duration

Delete call recordings and on-demand call recordings by their durations.