List UsageRecords

GET /v1/UsageRecords

Usage information for Sim resources

List UsageRecords

Query parameters

  • Sim string

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

  • Fleet string

    SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred.

  • Network string

    SID of a Network resource. Only show UsageRecords representing usage on this network.

  • IsoCountry string(iso-country-code)

    Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country.

  • Group string

    Dimension over which to aggregate usage records. Can be: sim, fleet, network, isoCountry. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the Granularity parameter.

    Values are sim, fleet, network, or isoCountry.

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

    Values are hour, day, or all.

  • StartTime string(date-time)

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

  • EndTime string(date-time)

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

  • PageSize integer

    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.

Responses

  • 200

    OK

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

        The SID of the Account that incurred the usage.

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

      • billed_unit string(currency) | null

        The currency in which the billed amounts are measured, specified in the 3 letter ISO 4127 format (e.g. USD, EUR, JPY).

      • data_download integer | null

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

      • data_total integer | null

        Total of data_upload and data_download.

      • data_total_billed number | null

        Total amount in the billed_unit that was charged for the data uploaded or downloaded.

      • data_upload integer | null

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

      • fleet_sid string | null

        SID of the Fleet resource on which the usage occurred.

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

      • iso_country string(iso-country-code) | null

        Alpha-2 ISO Country Code of the country the usage occurred in.

      • network_sid string | null

        SID of the Network resource on which the usage occurred.

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

      • The time period for which the usage is reported.

      • sim_sid string | null

        SID of a Sim resource to which the UsageRecord belongs.

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

GET /v1/UsageRecords
curl \
 -X GET https://supersim.twilio.com/v1/UsageRecords \
 --user "username:password"
Response examples (200)
{
  "meta": {
    "first_page_url": "https://example.com",
    "key": "string",
    "next_page_url": "https://example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://example.com",
    "url": "https://example.com"
  },
  "usage_records": [
    {
      "account_sid": "string",
      "billed_unit": "string",
      "data_download": 42,
      "data_total": 42,
      "data_total_billed": 42.0,
      "data_upload": 42,
      "fleet_sid": "string",
      "iso_country": "string",
      "network_sid": "string",
      "sim_sid": "string"
    }
  ]
}