Account UsageRecord Resource
The Usage Records resource returns aggregated usage for all SIMs on an Account. To retrieve usage for a single SIM, use the SIM Usage Records resource.
The Usage Records list resource returns total usage information for all SIMs on an Account. Usage data is gathered over a specified period, presented as a list, aggregated according to the user-provided granularity.
https://wireless.twilio.com/v1/UsageRecords
Usage Record Properties
This resource and its subresources always return a list of Usage Records. Each Usage Record is represented by the following properties:
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the AccountUsageRecord resource. |
period
|
The time period for which usage is reported. Contains |
commands
|
An object that describes the aggregated Commands usage for all SIMs during the specified period. See Commands Usage Object. |
data
|
An object that describes the aggregated Data usage for all SIMs over the period. See Data Usage Object. |
Commands Usage Object
The Commands usage object reports usage of Commands for the period. Usage detail is provided along three dimensions: Total, Home, and National Roaming.
The Commands Usage object is presented as a tree-like structure. For example, the total
value from the home
, national_roaming
, and international_roaming
child objects sum to the total
value of the top level commands
object. The same computations are done for the to_sim
and from_sim
parameters in the top level object.
Property | Type | Description | Empty Value |
---|---|---|---|
total | Integer | The total number of Commands sent (from_sim ) or received (to_sim ) by all SIMs linked to the account over the given period. |
0 |
to_sim | Integer | The number of Commands received by all SIMs linked to the account (to_sim ) throughout the period. |
0 |
from_sim | Integer | The number of Commands sent by all SIMs linked to the account (from_sim ) throughout the period. |
0 |
home | Object | An embedded Commands Usage Object that describes the number of Commands received by all SIMs linked to the account on the home network throughout the period, with keys total , to_sim and from_sim . |
null |
national_roaming | Object | An embedded Commands Usage Object that describes the number of Commands received by all SIMs linked to the account on national roaming partner networks throughout the period, with keys total , to_sim and from_sim . |
null |
international_roaming | Object | An embedded Commands Usage Object that describes the number of Commands received by all SIMs linked to the account on international roaming partner networks throughout the period, with keys total , to_sim and from_sim . |
[] |
Data Usage Object
The Data usage object reports usage of Data for the period. Usage detail is provided along three dimensions: Total, Home, and National Roaming.
The Data Usage object is presented as a tree-like structure. For example, the total
value from the home
child object and the national_roaming
child object sum to the total
value of the top level data
object. This is the same for the download
and upload
parameters.
Property | Type | Description | Empty Value |
---|---|---|---|
total | Integer | The total amount of Data consumed (downloaded and uploaded) by the SIM-connected device throughout the period. | 0 |
download | Integer | The amount of Data downloaded by the SIM-connected device throughout the period. | 0 |
upload | Integer | The amount of Data uploaded by SIM-connected device throughout the period. | 0 |
units | String | The units in which data usage is reported for the current object. Most often 'bytes'. | N/A |
home | Object | An embedded Data Usage Object that describes the amount of Data consumed by the SIM-connected device on the home network throughout the period, with keys total , download , upload and units . |
null |
national_roaming | Object | An embedded Data Usage Object that describes the amount of Data consumed by the SIM-connected device on national roaming partner networks throughout the period, with keys total , download , upload and units . |
null |
international_roaming | Object | An embedded Data Usage Object that describes the amount of Data consumed by the SIM-connected device on international roaming partner networks throughout the period, with keys total , download , upload and units . |
null |
List all Usage Records for an Account
https://wireless.twilio.com/v1/UsageRecords
HTTP GET
Returns a list of Usage Records for an account.
Parameters
Parameters in REST API format | |
---|---|
end
Optional
|
Only include usage that has occurred on or before this date. Format is ISO 8601. |
start
Optional
|
Only include usage that has occurred on or after this date. Format is ISO 8601. |
granularity
Optional
|
How to summarize the usage by time. Can be: |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.