Firsty

Search...

Search...

Core concepts

Usage

Data left, totals per period and country, and every session.

Usage comes at three levels of detail: what's left now, totals per period, and every single session. Totals and sessions are available per eSIM or for a whole profile.

What's left now

Get usage returns the total, used and remaining data across the eSIM's active packages. Use it for a "data left" figure. One package's own counters come from get package.

Totals per period

Usage history returns usage per period, split by type. Use it for a usage chart or a monthly statement.

GET /profiles/{profileReference}/esims/{esimReference}/usage/history
requests.get(
    "https://connect.test.firsty.app/api/v3/profiles/{profileReference}/esims/{esimReference}/usage/history",
    headers={
      "Authorization": "Bearer YOUR_ACCESS_TOKEN"
    },
    params={
      "from": [
        "2026-08-01",
        "2026-11-01T00:00:00"
      ],
      "aggregation": [
        "usageCountry,day",
        "usageCountry,day"
      ],
      "to": "2026-12-01T00:00:00",
      "timezone": "Europe/Amsterdam"
    }
)
  • aggregation is the period, hour, day or month, optionally after usageCountry to split each period by the country the usage happened in.
  • from and to are wall-clock times in timezone, without Z or an offset, and must fall on a period boundary: midnight for day, the 1st for month. to is exclusive.
  • The window reaches at most three calendar months back.

Every period in the window comes back, an empty usage array where nothing was used. Voice is always split by direction, and outgoing voice by destination country when known.

Profile usage history takes the same parameters and returns the same shape, summed across every eSIM the profile has held. Usage of an eSIM replaced by a swap stays in, so use it for a customer's total.

Every session

Usage sessions lists each data session, call and SMS, newest first, over the last three calendar months. Use it to answer "where did my data go". Data counts in whole bytes, voice in seconds, SMS in messages. A concealed number reads anonymous.

GET /profiles/{profileReference}/esims/{esimReference}/sessions
requests.get(
    "https://connect.test.firsty.app/api/v3/profiles/{profileReference}/esims/{esimReference}/sessions",
    headers={
      "Authorization": "Bearer YOUR_ACCESS_TOKEN"
    }
)

Profile usage sessions lists the sessions of every eSIM the profile has held, swapped-out ones included. Each session's esimReference names the eSIM it was used on.

A period's total in usage history equals the sum of the sessions in the same window. Both can differ from a package's own usage counters, so don't reconcile the two against each other.

Usage events

WebhookWhen
package.usageA package's usage grew by at least one whole unit. Carries the running total, not a delta.
package.usage.thresholdA package crossed one of your endpoint's thresholds, 33% and 66% unless you set others. Once per threshold per renewal.
esim.mccswitchThe eSIM registered on a different network than last time, with the previous and new country. The first registration carries no previous network.
sms.sentFirsty sent the customer of a local eSIM an SMS notification, such as on entering a country or running low on data. Its type says which. Sent to the network, not necessarily received.

esim.mccswitch is the signal that a traveller arrived somewhere new: the moment to offer a country plan.