REST API: Usage Records

The UsageRecords REST resource provides a simple API to retrieve usage made by your Twilio account during any time 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.

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 cap on usage, or if your application may have runaway requests. For more on usage triggers, see the Usage Triggers documentation.

UsageRecords List Resource

Resource URI

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

Resource Properties

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

Property Description
Category The category of usage. See Usage Categories below.
Description A human-readable description of the usage category.
AccountSid The Account that accrued the usage.
StartDate The first date for which usage is included in this UsageRecord, formatted as YYYY-MM-DD. All dates are in GMT.
EndDate The last date for which usage is included in this UsageRecord, formatted as YYYY-MM-DD. All dates are in GMT.
Usage The amount of billed usage (e.g. the number of call minutes billed for). This is frequently the same as Count, but may be different for certain usage categories like calls, where Count represents the number of calls and Usage represents the number of rounded, billed minutes.
UsageUnit The units in which Usage is measured. For example minutes for calls, messages for SMS.
Count The number of usage events (e.g. the number of calls).
CountUnit The units in which Count is measured. For example calls for calls, messages for SMS.
Price The total price of the usage, in the currency associated with the account.
PriceUnit The currency in which Price is measured, in ISO 4127 format (e.g. usd, eur, jpy).
Uri The URI that returns only this UsageRecord, relative to https://api.twilio.com.
SubresourceUris Subresource Uris for this UsageRecord. See List Subresources.
Usage, Count, and Price

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. And 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".

Usage Categories

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:

Category Description
calls All voice calls. Count is the number of calls and Usage is the number of minutes.
sms All SMS messages. Count and Usage are both the number of messages sent.
phonenumbers All phone numbers owned by the account.
recordings Recordings of voice calls. Count is the number of recordings and Usage is the number of recorded minutes.
transcriptions Transcriptions of voice calls. Count is the number of transcriptions and Usage is the number of transcribed minutes.
totalprice Total 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.

HTTP GET

Returns UsageRecords for all usage categories. The list includes paging information.

List Filters

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:

Parameter Description
Category Only include usage of this usage category.
StartDate Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
EndDate Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.

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. See Example 2 below.

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

List Subresources

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

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

Supported subresources are:

Subresource Description
Daily Return multiple UsageRecords for each usage category, each representing usage over a daily time-interval.
Monthly Return multiple UsageRecords for each usage category, each representing usage over a monthly time-interval.
Yearly Return multple UsageRecords for each usage category, each representing usage over a yearly time-interval.
AllTime Return a single UsageRecord for each usage category, each representing usage over the date-range specified. This is the same as the root /Usage/Records.
Today Return a single UsageRecord per usage category, for today's usage only.
Yesterday Return a single UsageRecord per usage category, for yesterday's usage only.
ThisMonth Return a single UsageRecord per usage category, for this month's usage only.
LastMonth Return 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.

Example 1: Last Month's Usage for All Usage Categories
Get records of Last Month
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, "LastMonth", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.lastMonth.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.last_month.list.each do |record|
    puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.LastMonth;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<LastMonth> records = LastMonth.read().execute();

    // Loop over records and print out a property for each one.
    for (LastMonth record : records) {
      System.out.println(record.getCount());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->last_month as $record) {
    echo $record->count;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of transcriptions and echo a property for each one
foreach ($client->usage->records->lastMonth->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords(Type.LAST_MONTH);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
Show Output
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "shortcodes-customerowned", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Customer Owned ShortCodes", 
         "end_date": "2012-09-30", 
         "usage_unit": "shortcodes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=shortcodes-customerowned&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "shortcodes"
      }, 
      {
         "category": "sms-inbound-shortcode", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound ShortCode SMS", 
         "end_date": "2012-09-30", 
         "usage_unit": "messages", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "messages"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>shortcodes-customerowned</Category>
         <Description>Customer Owned ShortCodes</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>shortcodes</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>shortcodes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=shortcodes-customerowned&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>sms-inbound-shortcode</Category>
         <Description>Inbound ShortCode SMS</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>messages</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>messages</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=sms-inbound-shortcode&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
Get records of Last Month
Get records of Today
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls", "Today", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.today.list({ category: "calls" }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.today.list({
    :category => "calls"}).each do |record|
    puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Today;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Today> records = Today.read().byCategory(Today.Category.CALLS).execute();

    // Loop over records and print out a property for each one.
    for (Today record : records) {
      System.out.println(record.getCount());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->today->getIterator(0, 50, array(
        "Category" => "calls"
    )) as $record
) {
    echo $record->count;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array("category" => "calls")
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsTodayList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.TODAY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
Show Output
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&StartDate=2012-10-13&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-10-13", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-10-13</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&amp;StartDate=2012-10-13&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris />
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
Get records of Today
Get records in a 1 Month Range
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", null, new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
      console.log(record.price);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list({
    :category => "calls-inbound",
    :start_date => "2012-09-01",
    :end_date => "2012-09-30"}).each do |record|
    puts record.price
end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.DateTime;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.read()
        .byCategory(Record.Category.CALLS_INBOUND)
        .byStartDate(DateTime.parse("2012-09-01"))
        .byEndDate(DateTime.parse("2012-09-30"))
        .execute();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getPrice());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage->records->read(
    array(
        "category" => "calls-inbound",
        "startDate" => "2012-09-01",
        "endDate" => "2012-09-30"
    )
);

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
Show Output
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "1", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls-inbound", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls-inbound", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls-inbound", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls-inbound", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls-inbound", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls-inbound", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls-inbound"
         }, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0.01", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "1", 
         "start_date": "2012-09-01", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>1</Count>
         <CountUnit>calls</CountUnit>
         <Usage>1</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.01</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls-inbound</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls-inbound</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls-inbound</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls-inbound</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls-inbound</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls-inbound</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls-inbound</Yearly>
         </SubresourceUris>
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
Get records in a 1 Month Range
Daily Records in a 1 Month Range
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", "Daily", new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.daily.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.price);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.daily.list({
    :category => "calls-inbound",
    :start_date => "2012-09-01",
    :end_date => "2012-09-30"}).each do |record|
    puts record.price
end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.DateTime;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Daily;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Daily> records = Daily.read()
        .byCategory(Daily.Category.CALLS_INBOUND)
        .byStartDate(DateTime.parse("2012-09-01"))
        .byEndDate(DateTime.parse("2012-09-30"))
        .execute();

    // Loop over records and print out a property for each one.
    for (Daily record : records) {
      System.out.println(record.getPrice());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->daily->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array(
            "category" => "calls-inbound",
            "startDate" => "2012-09-01",
            "endDate" => "2012-09-30"
        )
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsDailyList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.DAILY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
Show Output
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-30&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-30", 
         "count_unit": "calls"
      }, 
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-29", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-29&EndDate=2012-09-29", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-29", 
         "count_unit": "calls"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-30</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-30&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-29</StartDate>
         <EndDate>2012-09-29</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-29&amp;EndDate=2012-09-29</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
Daily Records in a 1 Month Range
Get all Records
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, null, null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list.each do |record|
    puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.read().execute();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getCount());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records as $record) {
    echo $record->count;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->usage->records->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords();
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
Show Output
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calleridlookups", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calleridlookups", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calleridlookups", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calleridlookups", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calleridlookups", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calleridlookups", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calleridlookups", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calleridlookups", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calleridlookups"
         }, 
         "description": "Caller ID Lookups", 
         "end_date": "2012-10-13", 
         "usage_unit": "lookups", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calleridlookups&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-08-15", 
         "count_unit": "lookups"
      }, 
      {
         "category": "calls", 
         "count": "21", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls"
         }, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0.38", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "21", 
         "start_date": "2012-08-15", 
         "count_unit": "calls"
      }
       . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calleridlookups</Category>
         <Description>Caller ID Lookups</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>lookups</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>lookups</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calleridlookups&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calleridlookups</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calleridlookups</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calleridlookups</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calleridlookups</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calleridlookups</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calleridlookups</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calleridlookups</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calleridlookups</Yearly>
         </SubresourceUris>
      </UsageRecord>
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>21</Count>
         <CountUnit>calls</CountUnit>
         <Usage>21</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.38</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls</Yearly>
         </SubresourceUris>
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
Get all Records

HTTP POST

Not supported.

HTTP PUT

Not supported.

HTTP DELETE

Not supported.

Full List of All Usage Categories

Voice
Category Description
calls All voice calls, inbound & outbound. Count is the number of calls and Usage is the number of minutes.
calls-inbound All inbound voice calls, to mobile, toll-free and local numbers.
calls-inbound-local All inbound voice calls to local numbers.
calls-inbound-mobile All inbound voice calls to mobile numbers.
calls-inbound-tollfree All inbound voice calls to toll-free numbers.
calls-outbound All outbound voice calls.
calls-sip All SIP calls.
calls-sip-inbound All inbound SIP calls.
calls-sip-outbound All outbound SIP calls.
calls-client All TwilioClient voice calls.
calls-globalconference All global conference calls.
call-progess-events All call progress events.
recordings Recordings of voice and trunking calls. Count is the number of recordings and Usage is the number of recorded minutes.
calls-recordings Recordings of voice calls. Count is the number of recordings and Usage is the number of recorded minutes.
recordingstorage Amount 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.
transcriptions Transcriptions of voice calls. Count is the number of transcriptions and Usage is the number of transcribed minutes.
SMS & MMS
Category Description
sms All SMS messages, both inbound and outbound. Count and Usage are both the number of messages sent.
sms-inbound All inbound SMS messages, to both short-codes and long-codes.
sms-inbound-longcode All inbound SMS messages to long-codes.
sms-inbound-shortcode All inbound SMS messages to short-codes.
sms-outbound All outbound SMS messages, from both short-codes and long-codes.
sms-outbound-longcode All outbound SMS messages from long-codes.
sms-outbound-shortcode All outbound SMS messages from short-codes.
mms All MMS messages, both inbound and outbound. Count and Usage are both the number of messages sent.
mms-inbound All inbound MMS messages, to both short-codes and long-codes.
mms-inbound-longcode All inbound MMS messages to long-codes.
mms-inbound-shortcode All inbound MMS messages to short-codes.
mms-outbound All outbound MMS messages, from both short-codes and long-codes.
mms-outbound-longcode All outbound MMS messages from long-codes.
mms-outbound-shortcode All outbound MMS messages from short-codes.
mediastorage Amount of storage used by media stored for the account. Count is the number of stored media files, Usage is the number of megabyes, and Price is the price of storing the media.
Phone Numbers
Category Description
phonenumbers All phone numbers owned by the account, mobile, toll-free and local.
phonenumbers-local All local phone numbers owned by the account.
phonenumbers-mobile All mobile phone numbers owned by the account.
phonenumbers-tollfree All toll-free phone numbers owned by the account.
phonenumbers-cps All phone number call per second (CPS) increases.
phonenumbers-setups All phone number setups fees.
shortcodes All ShortCodes owned by the account, of all types.
shortcodes-customerowned All ShortCodes owned by the account that are leased from another provider.
shortcodes-mms-enablement All Short Code MMS enablement fees.
shortcodes-mps All Short Code message per second (MPS) increases.
shortcodes-random All randomly-assigned ShortCodes owned by the account.
shortcodes-uk All UK ShortCodes owned by the account.
shortcodes-vanity All vanity ShortCodes owned by the account.
Lookups
Category Description
lookups All lookups, including carrier, caller id and number format lookups.
carrier-lookups All carrier lookups.
calleridlookups All callerID (CallerName) lookups.
number-format-lookups All number format lookups
Elastic SIP Trunking
Category Description
trunking-origination All trunking origination (inbound) calls, to mobile, toll-free and local numbers.
trunking-origination-local All trunking origination (inbound) calls to local numbers.
trunking-origination-mobile All trunking origination (inbound) calls to mobile numbers.
trunking-origination-tollfree All trunking origination (inbound) calls to toll-free numbers.
trunking-termination All trunking termination (outbound) calls.
trunking-recordings Recordings of trunking calls. Count is the number of recordings and Usage is the number of recorded minutes.
trunking-cps All trunking call per second (CPS) increases.
trunking-secure All secured trunking calls.
Task Router
Category Description
taskrouter-tasks All tasks created in Task Router.
Network Traversal
Category Description
turnmegabytes All TURN megabytes used in network traversal.
Authy
Category Description
authy-authentications All Authy authentications.
authy-calls-outbound All Authy outbound calls. Note that this usage is also included in the Voice categories.
authy-monthly-fees All Authy monthly fees.
authy-phone-intelligence All Authy phone intelligence requests.
authy-phone-verifications All Authy phone verifications.
authy-sms-outbound All Authy outbound SMS messages. Note that this usage is also included in the SMS categories.
Monitor
Category Description
monitor-reads All Monitor events API reads.
monitor-writes All Monitor events writes.
monitor-storage All Monitor events storage fees.
Other
Category Description
premiumsupport All premium support fees.
totalprice Total 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

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

1 / 1
Loading Code Samples...
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
Format:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, "LastMonth", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.lastMonth.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.last_month.list.each do |record|
    puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.LastMonth;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<LastMonth> records = LastMonth.read().execute();

    // Loop over records and print out a property for each one.
    for (LastMonth record : records) {
      System.out.println(record.getCount());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->last_month as $record) {
    echo $record->count;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of transcriptions and echo a property for each one
foreach ($client->usage->records->lastMonth->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords(Type.LAST_MONTH);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "shortcodes-customerowned", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Customer Owned ShortCodes", 
         "end_date": "2012-09-30", 
         "usage_unit": "shortcodes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=shortcodes-customerowned&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "shortcodes"
      }, 
      {
         "category": "sms-inbound-shortcode", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound ShortCode SMS", 
         "end_date": "2012-09-30", 
         "usage_unit": "messages", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "messages"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>shortcodes-customerowned</Category>
         <Description>Customer Owned ShortCodes</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>shortcodes</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>shortcodes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=shortcodes-customerowned&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>sms-inbound-shortcode</Category>
         <Description>Inbound ShortCode SMS</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>messages</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>messages</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=sms-inbound-shortcode&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
Format:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls", "Today", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.today.list({ category: "calls" }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.today.list({
    :category => "calls"}).each do |record|
    puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Today;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Today> records = Today.read().byCategory(Today.Category.CALLS).execute();

    // Loop over records and print out a property for each one.
    for (Today record : records) {
      System.out.println(record.getCount());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->today->getIterator(0, 50, array(
        "Category" => "calls"
    )) as $record
) {
    echo $record->count;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array("category" => "calls")
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsTodayList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.TODAY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&StartDate=2012-10-13&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-10-13", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-10-13</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&amp;StartDate=2012-10-13&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris />
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
Format:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", null, new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
      console.log(record.price);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list({
    :category => "calls-inbound",
    :start_date => "2012-09-01",
    :end_date => "2012-09-30"}).each do |record|
    puts record.price
end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.DateTime;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.read()
        .byCategory(Record.Category.CALLS_INBOUND)
        .byStartDate(DateTime.parse("2012-09-01"))
        .byEndDate(DateTime.parse("2012-09-30"))
        .execute();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getPrice());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage->records->read(
    array(
        "category" => "calls-inbound",
        "startDate" => "2012-09-01",
        "endDate" => "2012-09-30"
    )
);

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "1", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls-inbound", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls-inbound", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls-inbound", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls-inbound", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls-inbound", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls-inbound", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls-inbound"
         }, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0.01", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "1", 
         "start_date": "2012-09-01", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>1</Count>
         <CountUnit>calls</CountUnit>
         <Usage>1</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.01</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls-inbound</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls-inbound</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls-inbound</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls-inbound</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls-inbound</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls-inbound</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls-inbound</Yearly>
         </SubresourceUris>
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
Format:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", "Daily", new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.daily.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.price);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.daily.list({
    :category => "calls-inbound",
    :start_date => "2012-09-01",
    :end_date => "2012-09-30"}).each do |record|
    puts record.price
end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.DateTime;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Daily;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Daily> records = Daily.read()
        .byCategory(Daily.Category.CALLS_INBOUND)
        .byStartDate(DateTime.parse("2012-09-01"))
        .byEndDate(DateTime.parse("2012-09-30"))
        .execute();

    // Loop over records and print out a property for each one.
    for (Daily record : records) {
      System.out.println(record.getPrice());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->daily->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array(
            "category" => "calls-inbound",
            "startDate" => "2012-09-01",
            "endDate" => "2012-09-30"
        )
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsDailyList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.DAILY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-30&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-30", 
         "count_unit": "calls"
      }, 
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-29", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-29&EndDate=2012-09-29", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-29", 
         "count_unit": "calls"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-30</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-30&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-29</StartDate>
         <EndDate>2012-09-29</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-29&amp;EndDate=2012-09-29</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
Response Format:
  • json
  • xml
Format:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, null, null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list.each do |record|
    puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.read().execute();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getCount());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records as $record) {
    echo $record->count;
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->usage->records->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords();
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calleridlookups", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calleridlookups", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calleridlookups", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calleridlookups", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calleridlookups", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calleridlookups", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calleridlookups", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calleridlookups", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calleridlookups"
         }, 
         "description": "Caller ID Lookups", 
         "end_date": "2012-10-13", 
         "usage_unit": "lookups", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calleridlookups&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-08-15", 
         "count_unit": "lookups"
      }, 
      {
         "category": "calls", 
         "count": "21", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls"
         }, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0.38", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "21", 
         "start_date": "2012-08-15", 
         "count_unit": "calls"
      }
       . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calleridlookups</Category>
         <Description>Caller ID Lookups</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>lookups</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>lookups</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calleridlookups&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calleridlookups</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calleridlookups</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calleridlookups</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calleridlookups</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calleridlookups</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calleridlookups</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calleridlookups</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calleridlookups</Yearly>
         </SubresourceUris>
      </UsageRecord>
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>21</Count>
         <CountUnit>calls</CountUnit>
         <Usage>21</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.38</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls</Yearly>
         </SubresourceUris>
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>