Welcome!

Your live application with Twilio is ready to use!

Before you start, make sure that the checkbox "Add my Twilio Credentials (ACCOUNT_SID) and (AUTH_TOKEN) to ENV" is checked in the "Environmental Variables" of this Function. If it's not checked, enable it and click "Deploy All" at the bottom.

Check usage per To and From on main account or subaccounts

This page allows you to check how many messages and calls are associated with the To and From used to send/receive messages or calls.
The reults include alpha senders, SIP trunking, outbound replies to inbound messages etc... The data is divided based on the "Direction" of the message and call. Check the Message Resource and Call Resource to see all possible message/call "Direction" and what they mean.
If in the results "From" is shown as "null", it means that this is an inbound message/call and the "To" column needs to be looked at. Same applies if "To" is "null", in which case "From" needs to be looked at as it's an outbound message/call.
The Segments column applies to Messages, while the Minutes column applies to Calls. The column Assets shows the related To or From with the difference that the number is extracted from the Whastapp log and from the SIP Trunking log. Assets can be used to filter the results regardless of traffic type and direction.

Because the Messaging API only displays messages that were sent in the last 400 days, make sure that the selected From Date is within the last 400 days. An error will be returned if it's not.

The section "Group based on Country?" allows you to check from where the inbound messages/calls came from, and where your outbound messages/calls were sent to. For inbound traffic the country of the From is checked, while for outbound the country of the To is checked.
The Country is checked based on the "Country list" section. You are free to add and change the prefixes and country name as you see fit. The format must be "+prefix countryName". The countryName must start with a letter and it can only contain letters, - sign, and _ sign.
The prefix search is done from longest to shortest. For example, if an inbound message is received from the number "+15556789", and in the country list you have the prefixes "+1 US-CA" and "+1555 US-movies", in the results the country will be marked as "US-movies" because the longer prefix +1555 was detected for the number "+15556789".
If the prefix of a number is not on the country list, in the results those messages/calls will be marked with country 'Other'. Similarly, if you received inbound messages from alpha senders or short codes, they will be marked as "Alpha" and "ShortCode" respectively. For calls where the country is not detected, it will be marked as "TwilioClient" or "Other".

Because there could be many prefixes to check, the app might be slower if you are grouping by country. In order to speed up the app, delete the prefixes/countries you don't need. The default +1 prefix is marked as "United_States-Canada".

Be careful, if you deleted your Message and/or Call logs, or they are deleted automatically for your account, those messages/calls will not be part of the results with this report. Only messages/calls which are part of the 2 mentioned APIs will be included in the results. Same applies to the price/cost of the message/call - if there are costs associated with the message/call that are not part of the API, those costs will not be included in the results.

If you used many different numbers to send/receive messages, many alpha senders and similar, use the "Check Usage and Download Without Listing Data" button, which will download the results directly without listing them on this page.
If you are experiencing timeouts, adjust the "Maximum # of messages/calls per page" field. Regarless which number you input, all message and call logs will be checked.

While the number usage is being checked, a progress log will be displayed at the bottom.

Because this is a publicly accessible URL that automatically uses your Account SID and auth_token, to limit it's access, please set a password in your Function - open the Function and click on "Environment Variables" in the bottom left corner, and change the value of Password. Click "Deploy All" afterwards in the bottom left corner.

Password is 1

Password:

You are working with account:

Enter the subaccount SID. Leave empty if you want to check usage on your main account.

From Date: To Date (before): Maximum # of messages/calls per page (1-1000):
Include traffic type:  
Group based on Country?
Country list:

Select the format that will be used when the data is downloaded:



Select From-To date November 2023 to find usage.