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.
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.
Fields
Section titled “Fields”| Field | Type | What it is | On app.onsim |
|---|---|---|---|
id | string | The ID of the Data Session. | Not shown. |
sim | Party | The 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. |
at | string | When the network read the use. A Data Session has one time, and no start or end. | The Date & Time column. |
bytes | integer | The 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. |
countryoptional | string | The country where the SIM used the data, as an ISO 3166-1 alpha-3 code, such as GBR. | Not shown. |
chargeoptional | Charge | What 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.
Example
Section titled “Example”{ "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" } }}Methods
Section titled “Methods”The list needs a time window. There is no get of one Data Session: the list gives every field.
extensionoraccountgives the Data Sessions of one SIM. Give one of the two, not both.roaming=truegives only the Data Sessions abroad, androaming=falseonly those at home. With noroaming, the list has both.
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.