Firsty

Search...

Search...

Usage

Get aggregated usage history

Experimental. This endpoint is still settling — its request and response shape may change without a deprecation cycle.

Retrieves historical usage for an eSIM, aggregated per period and usage type, with optional usage-country buckets. Built from provider CDRs: recent periods may still change as files arrive, and totals can differ from the live counters returned by the packages endpoints.

from/to are wall-clock timestamps interpreted in timezone — they must not carry a zone designator (Z or offset) and must fall on the temporal aggregation boundary in that timezone (midnight for day, first of month for month). On the DST fall-back day a day period genuinely contains 25 hours; a spring-forward wall-clock gap is resolved by shifting across the gap.

Usage is attributed to the period containing the session's usageUpdatedAt. For every period the aggregated total exactly equals the sum of the sessions listed by the sessions endpoint for the same window; data usage is reported as whole bytes on both.

Every requested period is returned. Periods without usage have an empty usage array. Usage is always grouped by type. aggregation accepts grouping dimensions followed by a temporal period: day produces daily totals, while usageCountry,day produces daily totals per country where usage occurred and includes usageCountry in each country bucket. Voice is always additionally grouped by direction, and outgoing voice by destination country when known.

get/profiles/{profileReference}/esims/{esimReference}/usage/history

Authorization

Authorization: Bearer {token} — an OAuth2 access token from the client-credentials flow. How authentication works

Path parameters

profileReferencestringrequired

The eSIM's profile reference (16-digit numeric string)

esimReferencestringrequired

eSIM reference identifier (18-digit opaque token)

Query parameters

fromstringrequired

Period start (inclusive). Wall-clock in timezone, no zone designator, aligned to aggregation, and no more than 3 calendar months before the current wall-clock time.

tostring

Period end (exclusive, so a full period ends at the start of the next one). Same format and alignment as from; defaults to the next aggregation boundary after now (the in-progress period is included). Maximum span and lookback are 3 calendar months.

aggregationstringrequired

Comma-separated grouping dimensions followed by period size. Supported periods are hour, day, and month; usageCountry adds buckets for the country where usage occurred. Voice is always split by direction, and outgoing voice by destination country. Spans longer than 7 days require a day or month period.

OptionshourdaymonthusageCountry,hourusageCountry,dayusageCountry,month
timezonestring

Allowed IANA timezone used to interpret from/to and cut period boundaries.

OptionsUTCEurope/AmsterdamEurope/BerlinEurope/BrusselsEurope/LondonEurope/ParisAmerica/New_YorkAmerica/Los_AngelesAsia/SingaporeAsia/TokyoAustralia/Sydney
DefaultUTC

Responses

200Aggregated usage per periodapplication/json
Show response body
dataarray of UsagePeriodrequired

One entry per period, oldest first. Periods without any usage are included with an empty usage array.

Show properties
periodStartstring · date-timerequired

Inclusive period start, RFC 3339 with the requested timezone's offset

periodEndstring · date-timerequired

Exclusive period end

usagearray of UsagePeriodEntryrequired

Usage in this period, always split by type. The optional usageCountry dimension applies to every type. Voice is always split by direction, and outgoing voice by destination country when known. Only observed combinations are included.

Show properties
dataobject
Show properties
usednumberrequired

Amount used in unit; data usage is reported as whole bytes

usageCountrystring

ISO 3166-1 alpha-2 country where usage occurred, produced by the usageCountry aggregation dimension

sessionCountintegerrequired

Number of logical usage sessions contributing to this aggregate

typestringrequired
unitstringrequired
voiceobject
Show properties
usednumberrequired

Amount used in unit; data usage is reported as whole bytes

usageCountrystring

ISO 3166-1 alpha-2 country where usage occurred, produced by the usageCountry aggregation dimension

sessionCountintegerrequired

Number of logical usage sessions contributing to this aggregate

typestringrequired
unitstringrequired
directionstringrequired

Voice direction; unknown preserves usage whose provider direction is unavailable

Optionsincomingoutgoingunknown
destinationCountrystring

ISO 3166-1 alpha-2 destination country for outgoing voice, omitted when unknown or not applicable

smsobject
Show properties
usednumberrequired

Amount used in unit; data usage is reported as whole bytes

usageCountrystring

ISO 3166-1 alpha-2 country where usage occurred, produced by the usageCountry aggregation dimension

sessionCountintegerrequired

Number of logical usage sessions contributing to this aggregate

typestringrequired
unitstringrequired
400Bad request - invalid parameters401Unauthorized - missing or invalid API key403Forbidden - client does not have access to this resource404Resource not found429Rate limit exceeded500Internal server error