List usage record

GET /v1/Sims/{SimSid}/UsageRecords

Usage information for SIMs

Path parameters

  • SimSid string Required

    The SID of the Sim resource to read the usage from.

Query parameters

  • End string(date-time)

    Only include usage that occurred on or before this date, specified in ISO 8601. The default is the current time.

  • Start string(date-time)

    Only include usage that has occurred on or after this date, specified in ISO 8601. The default is one month before the end parameter value.

  • Granularity string

    How to summarize the usage by time. Can be: daily, hourly, or all. The default is all. A value of all returns one Usage Record that describes the usage for the entire period.

    Values are hourly, daily, or all.

  • PageSize integer(int64)

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

    Minimum value is 1, maximum value is 1000.

  • Page integer

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

    Minimum value is 0.

  • PageToken string

    The page token. This is provided by the API.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • usage_records array[object]
      Hide usage_records attributes Show usage_records attributes object
      • sim_sid string | null

        The SID of the Sim resource that this Usage Record is for.

      • account_sid string | null

        The SID of the Account that created the UsageRecord resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

      • period

        The time period for which the usage is reported. Contains start and end datetime values given as GMT in ISO 8601 format.

      • commands

        An object that describes the SIM's usage of Commands during the specified period. See Commands Usage Object.

      • data

        An object that describes the SIM's data usage during the specified period. See Data Usage Object.

    • meta object
      Hide meta attributes Show meta attributes object
      • first_page_url string(uri)
      • key string
      • next_page_url string(uri) | null
      • page integer
      • page_size integer
      • previous_page_url string(uri) | null
      • url string(uri)
GET /v1/Sims/{SimSid}/UsageRecords
curl \
 --request GET 'https://wireless.twilio.com/v1/Sims/{SimSid}/UsageRecords' \
 --user "username:password"
Response examples (200)
{
  "meta": {
    "key": "usage_records",
    "url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0",
    "page": 0,
    "page_size": 50,
    "next_page_url": null,
    "first_page_url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0",
    "previous_page_url": null
  },
  "usage_records": [
    {
      "data": {
        "home": {
          "total": 3494609,
          "units": "bytes",
          "billed": 0.35,
          "upload": 731560,
          "download": 2763049,
          "billing_units": "USD"
        },
        "total": 3494609,
        "units": "bytes",
        "billed": 0.35,
        "upload": 731560,
        "download": 2763049,
        "billing_units": "USD",
        "national_roaming": {
          "total": 0,
          "units": "bytes",
          "billed": 0,
          "upload": 0,
          "download": 0,
          "billing_units": "USD"
        },
        "international_roaming": []
      },
      "period": {
        "end": "2015-07-30T20:00:00Z",
        "start": "2015-07-30T20:00:00Z"
      },
      "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "commands": {
        "home": {
          "total": 3,
          "billed": 0,
          "to_sim": 2,
          "from_sim": 1,
          "billing_units": "USD"
        },
        "total": 3,
        "billed": 0,
        "to_sim": 2,
        "from_sim": 1,
        "billing_units": "USD",
        "national_roaming": {
          "total": 0,
          "billed": 0,
          "to_sim": 0,
          "from_sim": 0,
          "billing_units": "USD"
        },
        "international_roaming": []
      },
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    },
    {
      "data": {},
      "period": {},
      "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "commands": {},
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ]
}