Overview
Twilio users may need to export call recordings for their accounts or subaccounts, including metadata such as the originating and destination phone numbers. This article explains the available methods for exporting call recordings and retrieving associated phone numbers, suitable for both small and large volumes of recordings.
Environment
Twilio Console
What You Need To Know
Export Options
1. Using the Twilio REST API
- The Twilio Recordings API allows you to list and download all call recordings for your account or subaccount.
- Each recording resource includes a
call_sid. You can use thiscall_sidwith the Twilio Calls API to fetch call details, including thefromandtophone numbers. - For bulk exports, you may need to write a script that:
- Loops through all recordings,
- Retrieves the associated call details,
- Compiles the data (recording URLs, phone numbers, timestamps, etc.) into a CSV or other format.
Example Workflow
- List all recordings using the Recordings API.
- For each recording, use the
call_sidto fetch call details. - Download the recording file and save relevant metadata.
Tip: Twilio provides sample scripts and API documentation to help automate this process.
2. Manual Download via Twilio Console
- For a small number of recordings, you can manually download files from the Twilio Console Recordings page.
- Note: The Console does not support bulk export with phone number metadata; this must be done via the API.
Frequently Asked Questions
Can I export recordings for old calls?
Yes, as long as the recordings have not been deleted and are still available in your account, you can export both recent and older call recordings using the API.
Is there a way to include phone numbers in the export?
Yes. Use the call_sid from each recording to fetch the call details, which include the from and to phone numbers.
Is there a sample script available?
Twilio provides API documentation and sample code. If you need a specific example, you can request one from Twilio Support.
Conclusion
To export call recordings with phone numbers:
- Use the Twilio REST API for bulk exports and metadata retrieval.
- Use the Console for manual downloads of a small number of files.
- For automation, combine the Recordings and Calls APIs in a script.
Below you will find references to useful documents:
- Downloading and Deleting Twilio Call Recordings
- Twilio Recordings API Documentation
- Twilio Calls API Documentation
If you need further assistance or a sample script, reach out to Twilio Support.