SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site,, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Export a List of your Active Numbers using Twilio Functions

Using Twilio created functions you can quickly create a web app using Twilio Functions that allows you to export a list of  your active numbers and more!

This quick guide will walk you  through creating your Twilio powered app to export your phone number listing. It only takes about 10-15 minutes to set up. There is no coding required, just some copy and pasting on your part.

  • The app is powered by Twilio Functions within your Twilio account.
  • The app will allow you, and anyone on your team that you provide the app link and password, to view or export your active numbers listing from your account SID or a related subaccount.

Before creating the app on your Twilio account, you can test it on our Demo account. You can also see more details on our blog post on how to create this and other features on your Twilio account without coding: Quickly export a list of active Twilio numbers, transfer them, and check their usage

Creating your Twilio powered List Numbers Function

The application will need to be added to a Function created on the Twilio Functions page.

  • The function should be created on a desired Main account SID.
  • You will have the option to search the logs of the subaccount in the app itself.

Open the GIT repository here for List Active Numbers. We will reference this as we create the function in Console.

  1. Create a new Function in Console by going to the Twilio Functions page.
  2. Open the Functions folder in the GIT repository. 
    1. This folder will contain four files: get_account.js, list_accounts.js, list_numbers.js and mask_account.js
    2. In the Console add a new function (button in top left corner) and give it the same name as the file in the GIT folder (without .js at the end).
    3. Open the file in the GIT repository and copy the code from the file.
    4. Paste this code into the console function.
    5. Repeat this process for every Function file in the GIT folder.
  3. Open the Assets folder in the GIT repository. 
    1. This folder will contain three files: ce-paste-theme.css, index.html and styles.css
    2. In the Console add a new Asset (button in top left corner) and name it index.html
    3. Open the file in the GIT repository and copy the code from the file.
    4. Paste this code into to the console asset.
    5. Do the same thing for the two .css file.
      • For these assets, when you open them in the online Function, in the bottom-right corner it should say “html” and “css” respectively.
  4. Click on “Environmental Variables” and add a new key called “Password” with the desired value (this will be your password to use the app).
  5. Save all functions and assets.
  6. Next to the name of each you will see the current access level, set it to Public for all of them.
    • By default they are Private.
  7. Click on “Deploy All”, and wait for the deployment to be completed.
  8. Click on “Dependencies” and update some items as needed.
    • The twilio module version with ^3.61.0.
    • If the @twilio/runtime-handler version is not at least 1.2.1, change it to 1.2.1.
    • Change the Node version to 18 at the top.
  9. Click “Deploy All”, and wait for deployment.
  10. Click on index.html and in the bottom right corner click on “Copy URL
  11. Paste the URL in a new browser tab.
    • This will open the app that you can now use any time to get a list of your active numbers.

List Numbers Function Setup Video

Related Topics


Have more questions? Submit a request
Powered by Zendesk