Skip to content

Data Session

The mobile data that one of your SIMs used in about one hour. It is a reading, not a connection.

The network reads the use of each SIM about one time each hour. Each reading is one Data Session. A SIM that uses data all day has about 24 a day.

app.onsim.uk/team/users/203
Data
Used
1.29GB32%
Remaining
2.71GB68%
Plan
4GB
Data used32%
x
Projected 3.3GB by period end · 19 days left
1.00GB domestic·0.29GB roaming

This is the Data panel of a User’s page in app.onsim. It adds up the Data Sessions of the SIM since the start of the billing period. Used is the sum of their bytes, and the line climbs by the bytes of each day. The roaming note splits the same sum into the Data Sessions at home and those abroad, as roaming=false and roaming=true give them. The plan, what is left and the projection are not Data Sessions. The API does not give them.

FieldTypeWhat it isOn app.onsim
idstringThe ID of the Data Session.Not shown.
simPartyThe SIM that used the data: its extension, or its account when it has no extension.The Account column. app.onsim shows the account of the SIM, also when it has an extension.
atstringWhen the network read the use. A Data Session has one time, and no start or end.The Date & Time column.
bytesintegerThe data that the SIM used, in bytes, in both directions.The Volume column shows a rounded volume, in steps of 20 KiB. So it can be a little more than bytes.
countryoptionalstringThe country where the SIM used the data, as an ISO 3166-1 alpha-3 code, such as GBR.Not shown.
chargeoptionalChargeWhat we charge for the data. A Data Session has none when its record has no amount.The Charge column, in pounds to 2 decimal places. A Data Session with no charge shows a dash.

sim is a Party. A SIM of a User has the extension of the User. A SIM with no extension, such as a SIM in a router, has its account.

charge is a Charge, as on a Leg, with kib as its unit. quantity is the KiB that we bill, rounded up to the next 20 KiB, so it can be a little more than bytes. A Data Session has no used_quantity, because bytes gives that value. The destination is the data zone of the tariff.

{
"id": "30616228",
"sim": {
"extension": "203"
},
"at": "2026-10-12T06:39:01.000Z",
"bytes": 156721590,
"country": "GBR",
"charge": {
"amount": 0,
"currency": "GBP",
"quantity": 153060,
"unit": "kib",
"destination": {
"prefix": "MXGDATAZ1GBR",
"description": "Mobile Data (UK)",
"country": "GBR"
}
}
}

The list needs a time window. There is no get of one Data Session: the list gives every field.

  • extension or account gives the Data Sessions of one SIM. Give one of the two, not both.
  • roaming=true gives only the Data Sessions abroad, and roaming=false only those at home. With no roaming, the list has both.
Terminal window
curl "https://api.customer.onsim.uk/v1/data-sessions?from=2026-10-01T00:00:00Z&to=2026-10-08T00:00:00Z&extension=203" \
-H "x-api-key: $ONSIM_API_KEY"

Data Sessions are kept for about 90 days, as Calls are.