Usage
Raw voice, SMS and data records as one chronological feed, granular enough to bill on.
The usage record object
Retrieve raw voice, SMS, and data usage records for billing and suspension.
| Field | Type | Description |
|---|---|---|
idrequired | string | Identifier of this usage record. Stable, so you can deduplicate across pages.cdr_01j9v2k8f3m4n5p6q7r8s9t0u1 |
typerequired | enumVOICESMSMMSDATAUNKNOWN | What was metered. `UNKNOWN` is a record the network sent us that we could not classify.DATA |
providerrequired | string | The network that reported this usage.telia-denmark |
msisdnrequired | string | The number the usage was recorded against, in E.164 format.+4520123456 |
timeStartedrequired | string | When the session or message started, ISO 8601 UTC.2026-09-11T08:30:00.000Z |
timeEndedrequired | string | When it ended, ISO 8601 UTC. Null for records the network reports without a duration.2026-09-11T08:34:12.000Z |
amountrequired | number | Usage quantity, expressed in `unit`.10485760 |
unitrequired | enumsecondscountbytes | What `amount` counts: seconds for voice, count for messages, bytes for data.bytes |
servingCountryCoderequired | string | ISO-2 country serving the subscriber.DK |
usageClassrequired | enumdomesticroaminginternational | Where the usage sat relative to the home market.domestic |
counterpartyMsisdnrequired | string | Communication records only.+4598765432 |
callDirectionrequired | enuminboundoutbound | Which way the call or message went. Null for data.outbound |
counterpartyCountryCoderequired | string | ISO-2 country of the other party. Null for data.DK |
networkTyperequired | string | Data records only.5G |
userIdrequired | string | The end-user this usage belongs to, or null when the number is not attached to one.9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01 |
daterequired | string | Calendar day the usage is billed under, YYYY-MM-DD.2026-09-11 |
totalPricerequired | string | What this record costs, as a decimal string so no precision is lost. A connected voice call may also carry a one-off connection fee, which is included here and is not derivable from unitPrice. Null until the record is rated, and on usage covered by a pool.0.043200 |
unitPricerequired | string | The rate applied, as a decimal string. Priced per minute for voice, per binary megabyte (1024²) for data, and per message for SMS and MMS — so for voice and data this is not the same unit `amount` is counted in. Null until the record is rated.0.004320 |
currencyrequired | string | ISO 4217 currency of the prices. Null until rated.EUR |
rateIdrequired | string | The rate that priced this record, for reconciling a bill line by line. Null until rated.rate_01j9v2k8f3m4n5p6q7r8s9t0u1 |
Operations
List usage records
Returns raw voice, SMS, and data usage records for your organization whose timeStarted falls between startDate and endDate, as one feed — you do not need to know that we store calls and data separately. Records come in the order we stored or last corrected them, not by timeStarted.
Walk a period with the opaque cursor: send the first request with a startDate/endDate, then keep passing the nextCursor from each response until hasMore is false. Filter to one subscriber with userId.
Records are granular enough to bill on. Each arrives once the network reports it, from minutes to days after the usage depending on the market, and keeps its original timeStarted; a record we correct later comes round again with the same id. To poll incrementally, keep the cursor you sent for the last page and send it again, with the same window, on the next poll: you receive everything stored or corrected since, including records whose timeStarted is earlier than any you have seen. De-duplicate on id, keeping the latest copy. Records written in the last few minutes are held back until they settle. Expect usage from the last 24–48 hours to keep changing as late records arrive and are rated; the cursor delivers those updates.
Polling budget. Each API key allows 1000 requests per 24 hours, shared across every endpoint. Walk a whole organisation with the default page size rather than polling per subscriber — a request over the budget returns 429.
Requires the permission consumption:read on the key.
Try it in the playground → Calls run against your live organization; there is no sandbox.
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
startDaterequired | query | string (date) | Inclusive start of the usage window (YYYY-MM-DD, UTC).2026-09-01 |
endDaterequired | query | string (date) | Inclusive end of the usage window (YYYY-MM-DD, UTC). The window may span at most 31 days.2026-09-30 |
pageSize | query | integer | Records per page (max 100)50 |
cursor | query | string | Opaque cursor from a previous response's nextCursor. Omit for the first page.eyJjIjoiMjAyNi0wOS0xMVQwODozMDowMC4xMjM0NTZaI… |
userId | query | string (uuid) | Restrict to one end-user your organization owns. Omit for every user.9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01 |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | A page of usage records with a forward cursor. | UsageFeedResponse |
400 | Invalid cursor, a query window wider than the published maximum, or schema validation | none |
401 | Missing or invalid API key in the X-API-Key header | UnauthorizedError |
403 | The API key lacks the consumption:read scope | ForbiddenError |
429 | The API key has used its request quota for the current window. `Retry-After` says how many seconds until it resets. | TooManyRequestsError |
500 | Internal server error. Contact support if this persists. | InternalError |
Problems this endpoint can return
| Status | Problem | When |
|---|---|---|
400 | Invalid usage cursor | The usage feed is read with a cursor it did not hand out. |
Response fields
200 UsageFeedResponse
| Field | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
itemsrequired | array of UsageRecord | Usage records on this page, in the order they were stored or last corrected. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Show 20 child fields of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Field | Type | Description |
|---|---|---|
idrequired | string | Identifier of this usage record. Stable, so you can deduplicate across pages.cdr_01j9v2k8f3m4n5p6q7r8s9t0u1 |
typerequired | enumVOICESMSMMSDATAUNKNOWN | What was metered. `UNKNOWN` is a record the network sent us that we could not classify.DATA |
providerrequired | string | The network that reported this usage.telia-denmark |
msisdnrequired | string | The number the usage was recorded against, in E.164 format.+4520123456 |
timeStartedrequired | string | When the session or message started, ISO 8601 UTC.2026-09-11T08:30:00.000Z |
timeEndedrequired | string | When it ended, ISO 8601 UTC. Null for records the network reports without a duration.2026-09-11T08:34:12.000Z |
amountrequired | number | Usage quantity, expressed in `unit`.10485760 |
unitrequired | enumsecondscountbytes | What `amount` counts: seconds for voice, count for messages, bytes for data.bytes |
servingCountryCoderequired | string | ISO-2 country serving the subscriber.DK |
usageClassrequired | enumdomesticroaminginternational | Where the usage sat relative to the home market.domestic |
counterpartyMsisdnrequired | string | Communication records only.+4598765432 |
callDirectionrequired | enuminboundoutbound | Which way the call or message went. Null for data.outbound |
counterpartyCountryCoderequired | string | ISO-2 country of the other party. Null for data.DK |
networkTyperequired | string | Data records only.5G |
userIdrequired | string | The end-user this usage belongs to, or null when the number is not attached to one.9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01 |
daterequired | string | Calendar day the usage is billed under, YYYY-MM-DD.2026-09-11 |
totalPricerequired | string | What this record costs, as a decimal string so no precision is lost. A connected voice call may also carry a one-off connection fee, which is included here and is not derivable from unitPrice. Null until the record is rated, and on usage covered by a pool.0.043200 |
unitPricerequired | string | The rate applied, as a decimal string. Priced per minute for voice, per binary megabyte (1024²) for data, and per message for SMS and MMS — so for voice and data this is not the same unit `amount` is counted in. Null until the record is rated.0.004320 |
currencyrequired | string | ISO 4217 currency of the prices. Null until rated.EUR |
rateIdrequired | string | The rate that priced this record, for reconciling a bill line by line. Null until rated.rate_01j9v2k8f3m4n5p6q7r8s9t0u1 |
nextCursorrequiredeyJjIjoiMjAyNi0wOS0xMVQwODozMDowMC4xMjM0NTZaI…hasMorerequiredtrue/v1/usageRequest
curl -X GET "https://api.telgea.com/v1/usage" \
-H "x-api-key: $TELGEA_API_KEY"Response
{
"items": [
{
"id": "cdr_01j9v2k8f3m4n5p6q7r8s9t0u1",
"type": "DATA",
"provider": "telia-denmark",
"msisdn": "+4520123456",
"timeStarted": "2026-09-11T08:30:00.000Z",
"timeEnded": "2026-09-11T08:34:12.000Z",
"amount": 10485760,
"unit": "bytes",
"servingCountryCode": "DK",
"usageClass": "domestic",
"counterpartyMsisdn": null,
"callDirection": null,
"counterpartyCountryCode": null,
"networkType": "5G",
"userId": "9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01",
"date": "2026-09-11",
"totalPrice": "0.043200",
"unitPrice": "0.004320",
"currency": "EUR",
"rateId": "rate_01j9v2k8f3m4n5p6q7r8s9t0u1"
}
],
"nextCursor": "eyJjIjoiMjAyNi0wOS0xMVQwODozMDowMC4xMjM0NTZaIiwicyI6ImRhdGEiLCJpIjoiY2RyXzEifQ",
"hasMore": true
}