Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

REST API: Usage Records


The UsageRecords resource provides a simple API to retrieve actions made by your Twilio account during any period and by any usage category. This makes it easy to build reporting and analytics tools for your application.

UsageRecords used in combination with Subaccounts created for each of your end-users make it possible to build recurring usage-based billing systems on top of Twilio's API with just a few simple API calls. If rectifying UsageRecords with billing, see our dedicated article.

You can also set up usage triggers to notify your application when a particular category of usage reaches a threshold on a daily, monthly, yearly, or all-time basis. Triggers can help determine if your users have reached a usage cap or if your application has runaway requests.


UsageRecord Properties

usagerecord-properties page anchor

This resource and its subresources always return a list of UsageRecords. Each UsageRecord is represented by the following properties:

account_sidSID<AC>
Not PII

The SID of the Account(link takes you to an external page) that accrued the usage.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

api_versionstring

The API version used to create the resource.


as_ofstring

Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT


categoryenum<string>

The category of usage. For more information, see Usage Categories(link takes you to an external page).

Possible values:
a2p-registration-feesagent-conferenceamazon-pollyanswering-machine-detectionauthy-authenticationsauthy-calls-outboundauthy-monthly-feesauthy-phone-intelligenceauthy-phone-verificationsauthy-sms-outbound

countstring

The number of usage events, such as the number of calls.


count_unitstring

The units in which count is measured, such as calls for calls or messages for SMS.


descriptionstring

A plain-language description of the usage category.


end_datestring<date>

The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as YYYY-MM-DD.


pricenumber

The total price of the usage in the currency specified in price_unit and associated with the account.


price_unitstring<currency>

The currency in which price is measured, in ISO 4127(link takes you to an external page) format, such as usd, eur, and jpy.


start_datestring<date>

The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as YYYY-MM-DD.


subresource_urisobject<uri-map>

A list of related resources identified by their URIs. For more information, see List Subresources(link takes you to an external page).


uristring

The URI of the resource, relative to https://api.twilio.com.


usagestring

The amount used to bill usage and measured in units described in usage_unit.


usage_unitstring

The units in which usage is measured, such as minutes for calls or messages for SMS.


Usage, Count, and Price

usage-count-price page anchor

Each UsageRecord contains three amounts: Usage, Count, and Price. Usage is the primary way usage is measured for that category: minutes for calls, messages for SMS, etc. Count is the number of usage events: calls for calls, etc. Price is the price of the usage in the currency associated with the account.

Each UsageRecord also has fields that show the units in which each amount is measured: Usage is measured in units of UsageUnit, for instance. These fields make it easy to build usage dashboards. For example, you can always display human-readable strings describing usage with "$Usage $UsageUnits", "$Count $CountUnits", or "$Price $PriceUnits".


A UsageRecord's Category defines the type of usage it represents. The full list of all categories is here, but you'll usually focus on just a few common categories:

CategoryDescription
callsInbound and outbound voice calls. Does not include SIP or client calls. Count is the number of calls and Usage is the number of minutes.
smsAll SMS messages. Count and Usage are both the number of messages sent.
pfax-minutesProgrammable Fax minutes. Count is the number of faxes and Usage is the number of minutes.
pfax-pagesProgrammable Fax pages. Count is the number of faxes and Usage is the number of pages.
phonenumbersAll phone numbers owned by the account.
recordingsRecordings of voice calls. Count is the number of recordings and Usage is the number of recorded minutes.
transcriptionsTranscriptions of voice calls. Count is the number of transcriptions and Usage is the number of transcribed minutes.
pvAll Programmable Video usage including TURN. Price accounts for expenses in all Programmable Video products. Count and Usage should be ignored.
totalpriceTotal price of all usage. Usage will be the same as Price, and Count will be empty. Note that because some Twilio costs may not be included in any usage category, the sum of the Price of all UsageRecords may not be equal to the Price of TotalPrice.

Read multiple UsageRecord resources

read-multiple-usagerecord-resources page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Usage/Records.json

By default, the UsageRecords resource will return one UsageRecord for each Category, representing all usage accrued all-time for the account. You can filter the usage Category or change the date-range over which usage is counted using optional GET query parameters. Note that query parameters are case-sensitive:

Path parameters

path-parameters page anchor
AccountSidSID<AC>required

The SID of the Account(link takes you to an external page) that created the UsageRecord resources to read.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34
Categoryenum<string>

The usage category(link takes you to an external page) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.

Possible values:
a2p-registration-feesagent-conferenceamazon-pollyanswering-machine-detectionauthy-authenticationsauthy-calls-outboundauthy-monthly-feesauthy-phone-intelligenceauthy-phone-verificationsauthy-sms-outbound

StartDatestring<date>

Only include usage that has occurred on or after this date. Specify the date in GMT and format as YYYY-MM-DD. You can also specify offsets from the current date, such as: -30days, which will set the start date to be 30 days before the current date.


EndDatestring<date>

Only include usage that occurred on or before this date. Specify the date in GMT and format as YYYY-MM-DD. You can also specify offsets from the current date, such as: +30days, which will set the end date to 30 days from the current date.


IncludeSubaccountsboolean

Whether to include usage from the master account and all its subaccounts. Can be: true (the default) to include usage from the master account and all subaccounts or false to retrieve usage from only the specified account.


PageSizeinteger

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

Pageinteger

The page index. This value is simply for client state.

Minimum: 0

PageTokenstring

The page token. This is provided by the API.

Last Month's Usage for All Usage Categories

last-months-usage-for-all-usage-categories page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.usage.records.lastMonth
_10
.list({limit: 20})
_10
.then(lastMonth => lastMonth.forEach(l => console.log(l.asOf)));

Output

_41
{
_41
"end": 0,
_41
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=0&PageSize=1",
_41
"last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=68&PageSize=1",
_41
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=1",
_41
"num_pages": 69,
_41
"page": 0,
_41
"page_size": 1,
_41
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=0&PageSize=1",
_41
"start": 0,
_41
"total": 69,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth",
_41
"usage_records": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"as_of": "2019-06-24T22:32:49+00:00",
_41
"category": "sms-inbound-shortcode",
_41
"count": "0",
_41
"count_unit": "messages",
_41
"description": "Short Code Inbound SMS",
_41
"end_date": "2015-08-31",
_41
"price": "0",
_41
"price_unit": "usd",
_41
"start_date": "2015-08-01",
_41
"subresource_uris": {
_41
"all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=sms-inbound-shortcode",
_41
"daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=sms-inbound-shortcode",
_41
"last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode",
_41
"monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=sms-inbound-shortcode",
_41
"this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode",
_41
"today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=sms-inbound-shortcode",
_41
"yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=sms-inbound-shortcode",
_41
"yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode"
_41
},
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=sms-inbound-shortcode&StartDate=2015-08-01&EndDate=2015-08-31",
_41
"usage": "0",
_41
"usage_unit": "messages"
_41
}
_41
]
_41
}

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.usage.records.today
_10
.list({category: 'calls', limit: 20})
_10
.then(today => today.forEach(t => console.log(t.asOf)));

Output

_41
{
_41
"end": 0,
_41
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Page=0&PageSize=1",
_41
"last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Page=68&PageSize=1",
_41
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Page=1",
_41
"num_pages": 69,
_41
"page": 0,
_41
"page_size": 1,
_41
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Page=0&PageSize=1",
_41
"start": 0,
_41
"total": 69,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today",
_41
"usage_records": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"as_of": "2019-06-24T22:32:49+00:00",
_41
"category": "sms-inbound-shortcode",
_41
"count": "0",
_41
"count_unit": "messages",
_41
"description": "Short Code Inbound SMS",
_41
"end_date": "2015-09-04",
_41
"price": "0",
_41
"price_unit": "usd",
_41
"start_date": "2015-09-04",
_41
"subresource_uris": {
_41
"all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=sms-inbound-shortcode",
_41
"daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=sms-inbound-shortcode",
_41
"last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode",
_41
"monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=sms-inbound-shortcode",
_41
"this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode",
_41
"today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=sms-inbound-shortcode",
_41
"yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=sms-inbound-shortcode",
_41
"yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode"
_41
},
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=sms-inbound-shortcode&StartDate=2015-09-04&EndDate=2015-09-04",
_41
"usage": "0",
_41
"usage_unit": "messages"
_41
}
_41
]
_41
}

One-Month Date-Range, Inbound Calls Only

one-month-date-range-inbound-calls-only page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_15
// Download the helper library from https://www.twilio.com/docs/node/install
_15
// Find your Account SID and Auth Token at twilio.com/console
_15
// and set the environment variables. See http://twil.io/secure
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = require('twilio')(accountSid, authToken);
_15
_15
client.usage.records
_15
.list({
_15
category: 'calls-inbound',
_15
startDate: new Date(Date.UTC(2022, 5, 1)),
_15
endDate: new Date(Date.UTC(2022, 5, 30)),
_15
limit: 20
_15
})
_15
.then(records => records.forEach(r => console.log(r.asOf)));

Output

_41
{
_41
"end": 0,
_41
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=1",
_41
"last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=68&PageSize=1",
_41
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=1",
_41
"num_pages": 69,
_41
"page": 0,
_41
"page_size": 1,
_41
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=1",
_41
"start": 0,
_41
"total": 69,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records",
_41
"usage_records": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"as_of": "2019-06-24T22:32:49+00:00",
_41
"category": "totalprice",
_41
"count": null,
_41
"count_unit": "",
_41
"description": "Total Price",
_41
"end_date": "2015-09-04",
_41
"price": "2192.84855",
_41
"price_unit": "usd",
_41
"start_date": "2011-08-23",
_41
"subresource_uris": {
_41
"all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=totalprice",
_41
"daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=totalprice",
_41
"last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=totalprice",
_41
"monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=totalprice",
_41
"this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=totalprice",
_41
"today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=totalprice",
_41
"yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=totalprice",
_41
"yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=totalprice"
_41
},
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=totalprice&StartDate=2011-08-23&EndDate=2015-09-04",
_41
"usage": "2192.84855",
_41
"usage_unit": "usd"
_41
}
_41
]
_41
}

Daily Usage for Inbound Calls Over a One-Month Period

daily-usage-for-inbound-calls-over-a-one-month-period page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_15
// Download the helper library from https://www.twilio.com/docs/node/install
_15
// Find your Account SID and Auth Token at twilio.com/console
_15
// and set the environment variables. See http://twil.io/secure
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = require('twilio')(accountSid, authToken);
_15
_15
client.usage.records.daily
_15
.list({
_15
category: 'calls-inbound',
_15
startDate: new Date(Date.UTC(2022, 5, 1)),
_15
endDate: new Date(Date.UTC(2022, 5, 30)),
_15
limit: 20
_15
})
_15
.then(daily => daily.forEach(d => console.log(d.asOf)));

Output

_41
{
_41
"end": 0,
_41
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Page=0&PageSize=1",
_41
"last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Page=101843&PageSize=1",
_41
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Page=1",
_41
"num_pages": 101844,
_41
"page": 0,
_41
"page_size": 1,
_41
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Page=0&PageSize=1",
_41
"start": 0,
_41
"total": 101844,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily",
_41
"usage_records": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"as_of": "2019-06-24T22:32:49+00:00",
_41
"category": "sms-inbound-shortcode",
_41
"count": "0",
_41
"count_unit": "messages",
_41
"description": "Short Code Inbound SMS",
_41
"end_date": "2015-09-06",
_41
"price": "0",
_41
"price_unit": "usd",
_41
"start_date": "2015-09-06",
_41
"subresource_uris": {
_41
"all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=sms-inbound-shortcode",
_41
"daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=sms-inbound-shortcode",
_41
"last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode",
_41
"monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=sms-inbound-shortcode",
_41
"this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode",
_41
"today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=sms-inbound-shortcode",
_41
"yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=sms-inbound-shortcode",
_41
"yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode"
_41
},
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=sms-inbound-shortcode&StartDate=2015-09-06&EndDate=2015-09-06",
_41
"usage": "0",
_41
"usage_unit": "messages"
_41
}
_41
]
_41
}

All-Time Usage, All Usage Categories

all-time-usage-all-usage-categories page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.usage.records.list({limit: 20})
_10
.then(records => records.forEach(r => console.log(r.asOf)));

Output

_41
{
_41
"end": 0,
_41
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=1",
_41
"last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=68&PageSize=1",
_41
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=1",
_41
"num_pages": 69,
_41
"page": 0,
_41
"page_size": 1,
_41
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=1",
_41
"start": 0,
_41
"total": 69,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records",
_41
"usage_records": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"as_of": "2019-06-24T22:32:49+00:00",
_41
"category": "totalprice",
_41
"count": null,
_41
"count_unit": "",
_41
"description": "Total Price",
_41
"end_date": "2015-09-04",
_41
"price": "2192.84855",
_41
"price_unit": "usd",
_41
"start_date": "2011-08-23",
_41
"subresource_uris": {
_41
"all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=totalprice",
_41
"daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=totalprice",
_41
"last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=totalprice",
_41
"monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=totalprice",
_41
"this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=totalprice",
_41
"today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=totalprice",
_41
"yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=totalprice",
_41
"yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=totalprice"
_41
},
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=totalprice&StartDate=2011-08-23&EndDate=2015-09-04",
_41
"usage": "2192.84855",
_41
"usage_unit": "usd"
_41
}
_41
]
_41
}

For example, you might request all usage records for the month of April, 2012. In this case, the query string would be StartDate=2012-04-01&EndDate=2012-04-30. This would return one UsageRecord for each usage-type summarizing the usage during April. The list includes paging information.

It's also possible to group usage by day, by month, or by year using the subresources described below.

The main UsageRecords list resource supports a variety of convenience subresources. In general, these take the form:


_10
/2010-04-01/Accounts/{AccountSid}/Usage/Records/{Subresource}

Supported subresources are:

SubresourceDescription
DailyReturn multiple UsageRecords for each usage category, each representing usage over a daily time interval.
MonthlyReturn multiple UsageRecords for each usage category, each representing usage over a monthly time interval.
YearlyReturn multiple UsageRecords for each usage category, each representing usage over a yearly time interval.
AllTimeReturn a single UsageRecord for each usage category, each representing usage over the date range specified. This is the same as the root /Usage/Records.
TodayReturn a single UsageRecord per usage category, for today's usage only.
YesterdayReturn a single UsageRecord per usage category, for yesterday's usage only.
ThisMonthReturn a single UsageRecord per usage category, for this month's usage only.
LastMonthReturn a single UsageRecord per usage category, for last month's usage only.

These convenience subresources can be used to draw a graph of daily calls, display dashboards of monthly usage across all usage categories, or build a simple usage-based billing system based on last month's usage totals.

All subresources support the same list filters as the root UsageCounters resource.

Full List of All Usage Categories

usage-all-categories page anchor
CategoryDescription
agent-conferenceCount is the number of agent conferences and Usage is the number of minutes.
answering-machine-detectionAll answering machine detection recognitions for outbound calls. Count is the number of recognitions.
amazon-pollySpeech generated with Polly voices.
callsInbound and outbound voice calls. Count is the number of calls and Usage is the number of minutes. Does not include client or SIP calls.
calls-inboundAll inbound voice calls, to mobile, toll-free and local numbers.
calls-inbound-localAll inbound voice calls to local numbers.
calls-inbound-mobileAll inbound voice calls to mobile numbers.
calls-inbound-tollfreeAll inbound voice calls to toll-free numbers.
calls-outboundAll outbound voice calls.
calls-sipAll SIP calls.
calls-sip-inboundAll inbound SIP calls.
calls-sip-outboundAll outbound SIP calls.
calls-clientAll TwilioClient voice calls.
calls-globalconferenceAll global conference calls.
calls-media-stream-minutesAll Media Stream calls
calls-pay-verb-transactions<Pay> verb transactions. Count is total number of <Pay> transactions
call-progess-eventsAll call progress events.
calls-recordingsRecordings of voice calls. Count is the number of recordings and Usage is the number of recorded minutes.
programmablevoice-platformAll Programmable Voice Platform usage in Flex Projects
programmablevoiceconnectivityInbound and outbound voice calls in Flex Projects. Count is the number of calls and Usage is the number of minutes. Includes Client and SIP Calls.
programmablevoiceconn-sipAll SIP Calls in Flex Projects
programmablevoiceconn-sip-inboundAll Inbound SIP Calls in Flex Projects
programmablevoiceconn-sip-outboundAll Outbound SIP Calls in Flex Projects
programmablevoiceconn-clientsdkAll TwilioClient voice calls in Flex Projects
pstnconnectivityInbound and outbound voice calls in Flex Projects. Count is the number of calls and Usage is the number of minutes.
pstnconnectivity-inboundAll inbound voice calls, to mobile, toll-free and local numbers in Flex Projects
pstnconnectivity-outboundAll oubound voice calls in Flex Projects
recordingsRecordings of voice and trunking calls. Count is the number of recordings and Usage is the number of recorded minutes.
recordingstorageAmount of storage used by call recordings stored for the account. Count is the number of stored recordings, Usage is the number of stored recorded minutes, and Price is the price of storing the recordings.
speech-recognitionSpeech recognitions in calls. Count is the total number of calls where speech recognition was performed and usage is the total number of recognitions
transcriptionsTranscriptions of voice calls. Count is the number of transcriptions and Usage is the number of transcribed minutes.
tts-googleSpeech generated with Google voices.
virtual-agentVirtual Agent usage in calls. Count is the number of <VirtualAgent> invocations and Usage is the number of minutes.
voice-intelligenceAll Voice Intelligence transcriptions and language operators minutes
voice-intelligence-transcriptionVoice Intelligence transcriptions minutes
voice-intelligence-operatorsVoice Intelligence language operators minutes
voice-insightsVoice Insights Advanced Features
voice-insights-ptsn-insights-on-demand-minuteVoice Insights Advanced Features for Programmable Voice calls
voice-insights-sip-trunking-insights-on-demand-minuteVoice Insights Advanced Features for Elastic SIP Trunking calls.
CategoryDescription
a2p-registration-feesAll Messaging A2P Registration Fees
smsAll SMS messages, both inbound and outbound. Count and Usage are both the number of messages sent.
sms-inboundAll inbound SMS messages, to both short-codes and long-codes.
sms-inbound-longcodeAll inbound SMS messages to long-codes.
sms-inbound-shortcodeAll inbound SMS messages to short-codes.
sms-outboundAll outbound SMS messages, from both short-codes and long-codes.
sms-outbound-longcodeAll outbound SMS messages from long-codes.
sms-outbound-shortcodeAll outbound SMS messages from short-codes.
sms-messages-carrierfeesAll carrier fees for SMS messages.
mmsAll MMS messages, both inbound and outbound. Count and Usage are both the number of messages sent.
mms-inboundAll inbound MMS messages, to both short-codes and long-codes.
mms-inbound-longcodeAll inbound MMS messages to long-codes.
mms-inbound-shortcodeAll inbound MMS messages to short-codes.
mms-outboundAll outbound MMS messages, from both short-codes and long-codes.
mms-outbound-longcodeAll outbound MMS messages from long-codes.
mms-outbound-shortcodeAll outbound MMS messages from short-codes.
mms-messages-carrierfeesAll carrier fees for MMS messages.
mediastorageAmount of storage used by media stored for the account. Count is the number of stored media files, Usage is the number of megabytes, and Price is the price of storing the media.

WhatsApp Business API

usage-whatsapp page anchor
CategoryDescription
channels-whatsapp-outboundWhatsApp Conversations Fees. WhatsApp charges per user- or business-initiated conversation in 24-hour increments that start when the first message from a business is delivered. See our pricing page for details.(link takes you to an external page)
channels-whatsapp-inboundUser-initiated conversation fees are charged on a business' first response to user messages. See our pricing page for details.(link takes you to an external page)
channels-messaging-inboundTwilio charges a flat-rate per inbound message platform fee for any country.
channels-messaging-outboundTwilio charges a flat-rate per outbound message platform fee for any country.

Twilio Conversations

usage-prog-chat page anchor
CategoryDescription
pchat-usersActive Monthly Users - An active user is defined as someone who creates a user or conversation, edits, or is assigned to a conversation. This includes reading conversations, sending messages in a chat view, or sending and receiving SMS and WhatsApp messages via the Conversations product.
pchat-conv-med-storageMedia Storage - Photos, videos, or other files stored and distributed in Conversations are billed at a monthly rate according to their size, prorated daily. Only stored media (pictures, videos, etc.) incurs a charge; ordinary text-only message bodies are stored at no cost.
CategoryDescription
phonenumbersAll phone numbers owned by the account, mobile, toll-free and local.
phonenumbers-localAll local phone numbers owned by the account.
phonenumbers-mobileAll mobile phone numbers owned by the account.
phonenumbers-tollfreeAll toll-free phone numbers owned by the account.
phonenumbers-cpsAll phone number calls per second (CPS) increases.
phonenumbers-setupsAll phone number setups fees.
shortcodesAll ShortCodes owned by the account, of all types.
shortcodes-customerownedAll ShortCodes owned by the account that are leased from another provider.
shortcodes-mms-enablementAll Short Code MMS enablement fees.
shortcodes-mpsAll Short Code message per second (MPS) increases.
shortcodes-randomAll randomly-assigned ShortCodes owned by the account.
shortcodes-ukAll UK ShortCodes owned by the account.
shortcodes-vanityAll vanity ShortCodes owned by the account.
CategoryDescription
lookupsAll Lookups executed across all categories
carrier-lookupsAll Carrier lookups
calleridlookupsAll Caller Name lookups
number-format-lookupsAll Number Formatting lookups
call-forwarding-lookupsAll Call Forwarding lookups
sim-swap-lookupsAll SIM Swap lookups
live-activity-lookupsAll Live Activity lookups
enhanced-line-type-lookupsAll Line Type Intelligence lookups
identity-matchAll Identity Match lookups
CategoryDescription
trunking-originationAll trunking origination (inbound) calls, to mobile, toll-free and local numbers.
trunking-origination-localAll trunking origination (inbound) calls to local numbers.
trunking-origination-mobileAll trunking origination (inbound) calls to mobile numbers.
trunking-origination-tollfreeAll trunking origination (inbound) calls to toll-free numbers.
trunking-terminationAll trunking termination (outbound) calls.
trunking-recordingsRecordings of trunking calls. Count is the number of recordings and Usage is the number of recorded minutes.
trunking-cpsAll trunking calls per second (CPS) increases.
trunking-secureAll secured trunking calls.
voice-insights-sip-trunking-insights-on-demand-minuteVoice Insights Advanced Features for trunking calls
CategoryDescription
sync-actionsAll incoming requests from your application that read and write data. It means actions include any read or write from an SDK or the REST API. Resulting webhooks, updates to connected endpoints, and storage are included in the cost of an action.
sync-endpoint-hoursAn endpoint-hour is counted once per wall-clock hour for each unique device connected to Sync. Endpoints can be unique devices or browser tabs. Each unique endpoint will incur charges for at most four hours of every calendar day; the remainder are free of charge.
sync-endpoint-hours-above-daily-capAll hours spent above four hours limit are shown separately. All these hours are free of charge.
CategoryDescription
taskrouter-tasksAll tasks created in Task Router.

Programmable Video

usage-video page anchor
CategoryDescription
pvAll Programmable Video usage including TURN. Price accounts for expenses in all Programmable Video products. Count and Usage should be ignored.
group-roomsAccounts for all Group Rooms usage. Count is the number of rooms. Usage should be ignored.
group-rooms-participant-minutesAll participant usage in Group Rooms. Count and Usage measure the number of participant minutes.
group-rooms-data-trackAll Group Room Data Tracks activity. Count and Usage measure thousands of messages sent.
small-group-roomsAccounts for all Small Group Rooms usage. Count is the number of rooms. Usage should be ignored.
small-group-rooms-participant-minutesAll participant usage in Small Group Rooms. Count and Usage measure the number of participant minutes.
small-group-rooms-data-trackAll Small Group Room Data Tracks activity. Count and Usage measure thousands of messages sent.
pv-roomsAccounts for all Peer-to-Peer Rooms usage. Count is the number of rooms. Usage is the number of participant minutes.
peer-to-peer-rooms-participant-minutesAll participant usage in P2P Rooms. Count and Usage measure the number of participant minutes.
video-recordingsAll usage regarding video Recordings and Compositions. Count and Usage should be ignored.
group-rooms-recorded-minutesAll Recordings generated out of Group Rooms (including Small Group Rooms). Count and Usage measure the number of recorded participant minutes.
pv-composition-minutesAll Video Recording Compositions. Count and Usage measure the number of composition minutes.
group-rooms-encrypted-media-recordedAll encrypted media including Group Room Recordings and Compositions. Count and Usage measure the number of encrypted participant minutes and composition minutes.
group-rooms-media-storedAll media stored in Twilio by Programmable Video Services including Recordings and Compositions. Count and Usage measure the number of stored GB/day (Gigabytes per day).
group-rooms-media-downloadedAll media downloaded from Twilio regarding Programmable Video Services. This includes Recordings and Compositions. Count and Usage measure the number of downloaded GB (Gigabytes).
turnmegabytesAll TURN data relayed by Twilio. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-australiaTURN data relayed by Twilio in the Australia AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-brasilTURN data relayed by Twilio in the Brazil AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-indiaTURN data relayed by Twilio in the India AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-irelandTURN data relayed by Twilio in the Ireland AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-japanTURN data relayed by Twilio in the Japan AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-singaporeTURN data relayed by Twilio in the Singapore AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-useastTURN data relayed by Twilio in the US (East) AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-uswestTURN data relayed by Twilio in the US (West) AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
turnmegabytes-germanyTURN data relayed by Twilio in the Germany AWS region. Count and Usage measure the relayed traffic in MB (Megabytes)
CategoryDescription
pchat-usersActive Monthly Users - An active user is defined as someone who creates a user or conversation, or edits, or is assigned to a chat channel. This includes reading conversations or sending messages.
pchat-conv-med-storageMedia Storage - Photos, videos, or other files stored and distributed in chat channels are billed at a monthly rate according to their size, prorated daily. Only stored media (pictures, videos, etc.) incurs a charge; ordinary text-only message bodies are stored at no cost.
CategoryDescription
verify-pushAll Verify push verifications. Each verification is defined as a challenge that is updated with a status of approved or denied.
verify-totpAll Verify TOTP verifications. Each verification is defined as a challenge that is updated with a status of approved.
verify-snaAll Verify Silent Network Auth (SNA) verifications.
authy-phone-verificationsAll Verify SMS and Voice verifications.
authy-verify-email-verificationsAll Verify email verifications.
authy-verify-outbound-emailAll Verify one-time tokens requested to be delivered via email.
verify-whatsapp-conversations-business-initiatedAll WhatsApp business-initiated conversations associated with using Verify to send one-time-passcode messages to WhatsApp users.
CategoryDescription
authy-authenticationsAll Authy authentications.
authy-calls-outboundAll Authy outbound calls. Note that this usage is also included in the Voice categories.
authy-monthly-feesAll Authy monthly fees.
authy-phone-intelligenceAll Authy phone intelligence requests.
authy-sms-outboundAll Authy and Verify outbound SMS messages. Note that this usage is also included in the SMS categories.
authy-outbound-emailAll Authy one-time tokens requested to be delivered via email.
CategoryDescription
studio-engagementsAll Studio Engagements
CategoryDescription
monitor-readsAll Monitor events API reads.
monitor-writesAll Monitor events writes.
monitor-storageAll Monitor events storage fees.

Internet of Things

iot page anchor
CategoryDescription
wireless-orders-starterAll Programmable Wireless Starter Packs ordered.
wireless-orders-bulkAll Programmable Wireless Bulk SIMs ordered.
wireless-mrc-paygAll Programmable Wireless Monthly Fees for SIMs using PAYG data metering.
CategoryDescription
eventsAll Event Streams events delivered. Usage is in thousands of events.
CategoryDescription
premiumsupportAll premium support fees.
totalpriceTotal price of all usage. Usage will be the same as Price, and Count will be empty. Note that because some Twilio costs may not be included in any usage category, the sum of the Price in all UsageRecords may or may not be equal to the Price of TotalPrice.

UsageRecords Instance Resource

instance page anchor

You cannot make requests directly to a UsageRecord resource. Instead, request the UsageRecords list resource or one of its subresources.


Rate this page: