Menu

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

UsageRecord Resource

To avoid ambiguity throughout this page, Sim (initial cap) refers to the Sim API resource. SIM (all caps) refers to the physical Subscriber Identity Module (that is, a SIM card) associated with a Sim resource.

A UsageRecord represents aggregated usage information over a specified period for either all Super SIMs on an account or for a single Super SIM, if the Sim resource is provided as a query parameter. Usage data is aggregated according to the user-provided granularity.

All dates and times are presented in UTC.

The amounts in UsageRecords are presented in the period when the usage occurred, not when it was received and processed by Twilio, to better associate the information from this resource with real world events.

UsageRecord properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that incurred the usage.

sim_sid
sid<HS> Not PII

SID of a Sim resource to which the UsageRecord belongs. Will be null when UsageRecords are aggregated at the Account level.

period
object Not PII

The time period for which the usage is reported. The period is represented as a pair of start_time and end_time timestamps specified in ISO 8601 format.

data_upload
long Not PII

Total data uploaded in bytes, aggregated by the query parameters.

data_download
long Not PII

Total data downloaded in bytes, aggregated by the query parameters.

data_total
long Not PII

Total of data_upload and data_download.

Read UsageRecord resources

get
https://supersim.twilio.com/v1/UsageRecords

Retrieve a list of UsageRecords over a specified period aggregated according to the user-provided granularity.

Parameters
Parameters in REST API format
sim
Optional
get sid_like<HS> Not PII

SID of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM.

granularity
Optional
get ienum:granularity Not PII

Time-based grouping that UsageRecords should be aggregated by. Can be: hour, day, or all. Default is all. all returns one UsageRecord that describes the usage for the entire period.

start_time
Optional
get date_time<iso8601> Not PII

Only include usage that occurred at or after this time, specified in ISO 8601 format. Default is one month before the end_time.

end_time
Optional
get date_time<iso8601> Not PII

Only include usage that occurred before this time, specified in ISO 8601 format. Default is the current time.

Example 1
        
        
        
        
        Retrieve the aggregated usage for the entire period

        Read a UsageRecord

        Retrieve the aggregated usage for the entire period
        Example 2
              
              
              
              
              Retrieve usage aggregated by day

              Read Daily UsageRecords

              Retrieve usage aggregated by day
              Example 3
                    
                    
                    
                    
                    Retrieve usage aggregated by hour

                    Read Hourly UsageRecords

                    Retrieve usage aggregated by hour
                    Example 4
                          
                          
                          
                          
                          Retrieve usage for a Super SIM by day

                          Read Daily SIM Usage Records

                          Retrieve usage for a Super SIM by day
                          Rate this page:

                          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.