Usage records track subscription usage for users. This includes data, voice, and text usage. Note that there is a delay in usage data that varies between carriers.
Type of object is always usageRecord.
usageRecord Amount of data used in bytes.
18883100Amount of on-device data used in bytes.
30029300Amount of tethering data used in bytes.
30029300Timestamp representing the exclusive upper bound of the aggregation period (e.g. the end of a 24 hour period, subscription period or user-defined set of dates).
"2021-02-15T00:00:00Z"The ISO 3166-1 alpha-2 country code of the country in which the usage occurred.
"US"The roaming mode the usage occurred in.
none international domestic The unique identifier for the subscription to which the usage is attributed.
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"Amount of SMS messages sent and received.
15Amount of SMS messages sent internationally.
6Amount of SMS messages sent locally.
6Timestamp representing the inclusive lower bound of the aggregation period (e.g. the start of a 24 hour period, subscription period or user-defined set of dates)
"2021-02-14T00:00:00Z"The time at which the aggregation was last updated.
"2024-02-15T12:13:14Z"Amount of voice usage in seconds.
240Amount of international voice usage in seconds.
125Amount of local voice usage in seconds.
6{
"object": "usageRecord",
"data": 18883100,
"dataDeviceBytes": 30029300,
"dataTetheringBytes": 30029300,
"end": "2021-02-15T01:01:01.0Z",
"labels": {
"country": "US",
"roaming": "none",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"sms": 15,
"smsInternationalMessages": 6,
"smsLocalMessages": 6,
"start": "2021-02-14T01:01:01.0Z",
"updatedAt": "2024-02-15T12:13:14.0Z",
"voice": 240,
"voiceInternationalSeconds": 125,
"voiceLocalSeconds": 6
}
Lists usage records in ascending order for a subscription, defaulting to daily aggregation for the latest subscription period. If none of the start, end, or period parameters is provided, records are returned for the latest subscription period.
The unique identifier for the subscription.
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"Limits the usage data returned to the subscription period provided. This option is incompatible with the start and end parameters.
12>= 1Limits the usage data to dates greater than or equal to the provided date. Can only be used in combination with end.
"2021-06-19"Limits the usage data to dates up to and including the provided date. Can only be used in combination with start.
"2021-11-14"Determines the aggregation method used, defaulting to daily. period provides aggregated values for the time range or period requested. The roaming aggregation is in preview and may only be used in particular cases.
daily period country roaming daily,country daily,roaming period,country period,roaming country,daily country,period roaming,daily roaming,period Returns the list of usage records.
Type of object is always list.
list usageRecord.A unique identifier to be used as after pagination parameter if more items are available sorted after the current batch of items.
A unique identifier to be used as before pagination parameter if more items are available sorted before the current batch of items.
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptions/{subscription}/usage \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
{
"object": "list",
"items": [
{
"object": "usageRecord",
"data": 18883100,
"dataDeviceBytes": 30029300,
"dataTetheringBytes": 30029300,
"end": "2021-02-15T00:00:00Z",
"labels": {
"country": "US",
"roaming": "none",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"sms": 15,
"smsInternationalMessages": 6,
"smsLocalMessages": 6,
"start": "2021-02-14T00:00:00Z",
"updatedAt": "2024-02-15T12:13:14Z",
"voice": 240,
"voiceInternationalSeconds": 125,
"voiceLocalSeconds": 6
}
],
"moreItemsAfter": null,
"moreItemsBefore": null
}
Simulates usage on a subscription with a test SIM. Can be used to test usage notifications. Subscription must be in status "active".
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Amount of data used in bytes.
188831000>= 0Amount of on-device data used in bytes.
1029381200>= 0Amount of tethering data used in bytes.
1029381200>= 0Amount of voice usage in seconds.
2400>= 0Amount of local voice usage in seconds.
3290>= 0Amount of international long distance voice usage in seconds.
3290>= 0Amount of SMS messages sent and received.
150>= 0Amount of local SMS messages sent and received.
40>= 0Amount of international long distance SMS messages sent and received.
40>= 0The unique identifier for the subscription addon to which the simulated usage should be attributed. If not provided, the usage won't be attributed to any add-on.
"sad_0SNlurA049MEWV2UNWPbDfW5B40U"The ISO 3166-1 alpha-2 country code to assign to the simulated usage. If not provided, the usage will be assigned to the home country of the provider.
"US"The roaming mode to assign to the simulated usage.
nonenone international domestic The Usage Balance id to assign the simulated usage to.
"ubl_0SNlurA049MEWV4VxLfwJc3PJtHc"The amount of usage to attribute to the specified Usage Balance.
The unique identifier for the subscription.
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"Returns the relevant usage record.
Type of object is always usageRecord.
usageRecord Amount of data used in bytes.
18883100Amount of on-device data used in bytes.
30029300Amount of tethering data used in bytes.
30029300Timestamp representing the exclusive upper bound of the aggregation period (e.g. the end of a 24 hour period, subscription period or user-defined set of dates).
"2021-02-15T00:00:00Z"The ISO 3166-1 alpha-2 country code of the country in which the usage occurred.
"US"The roaming mode the usage occurred in.
none international domestic The unique identifier for the subscription to which the usage is attributed.
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"Amount of SMS messages sent and received.
15Amount of SMS messages sent internationally.
6Amount of SMS messages sent locally.
6Timestamp representing the inclusive lower bound of the aggregation period (e.g. the start of a 24 hour period, subscription period or user-defined set of dates)
"2021-02-14T00:00:00Z"The time at which the aggregation was last updated.
"2024-02-15T12:13:14Z"Amount of voice usage in seconds.
240Amount of international voice usage in seconds.
125Amount of local voice usage in seconds.
6curl https://api.gigs.com/testing/projects/${GIGS_PROJECT}/subscriptions/{subscription}/usage \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json" \
-d '{
"data": 18883100,
"dataDevice": 102938120,
"dataTethering": 102938120,
"voice": 240,
"voiceLocal": 329,
"voiceInternational": 329,
"sms": 15,
"smsLocal": 4,
"smsInternational": 4,
"subscriptionAddon": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
"country": "US",
"roaming": "none",
"usageBalance": "ubl_0SNlurA049MEWV4VxLfwJc3PJtHc"
}'
{
"object": "usageRecord",
"data": 18883100,
"dataDeviceBytes": 30029300,
"dataTetheringBytes": 30029300,
"end": "2021-02-15T00:00:00Z",
"labels": {
"country": "US",
"roaming": "none",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"sms": 15,
"smsInternationalMessages": 6,
"smsLocalMessages": 6,
"start": "2021-02-14T00:00:00Z",
"updatedAt": "2024-02-15T12:13:14Z",
"voice": 240,
"voiceInternationalSeconds": 125,
"voiceLocalSeconds": 6
}