Subscription Usage
Get subscription usage.
Get subscription usage
/subscriptions/{subscriptionId}/usageRetrieve the current period's usage for a subscription.
Path parameters
subscription IdstringrequiredThe identifier of the subscription. May be the entity's internal UUID or an external reference identifier.
Reference identifiers MUST be prefixed with rid_ (e.g., rid_crm-subscription-12345) so the API
can distinguish them from internal UUIDs. The prefix is stripped before lookup.
Responses
200Current usage statistics for the subscription.
application/json
Current usage statistics for the subscription.
Current usage statistics for the subscription.
objectUsage
Current usage statistics for a subscription, organized by service type (voice, SMS, MMS, data). Within each service type, usage is broken down into per-package allowance buckets: the base plan's included allowance plus any add-on packages, each reporting used, remaining, and total amounts. A service type is omitted entirely when the subscription has no allowances of that type.
voiceobjectVoice call usage across all scopes and packages.
Voice call usage for a subscription, split by where and to whom calls are made: national (domestic calls), roaming (calls made while abroad), and ILD (international long distance — calls placed from the home country to foreign numbers).
Show child attributes
nationalarray of UsageVoicePackageAllowance buckets for calls made within the home country, including the base plan's voice allowance and any add-on packages.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
call Secondsintegerint64requiredCall time consumed from this allowance so far, in seconds.
call Countintegerint64requiredNumber of calls placed against this allowance.
call Remaining Secondsintegerint64requiredCall time still available in this allowance, in seconds.
call Total Secondsintegerint64requiredThe full call time allowance of this package, in seconds.
statusenum<string>requiredThe status of this package.
Whether a usage package is currently consumable.
- ACTIVE: The package is in its validity window and usage draws from it
- NOT_ACTIVE: The package exists but is not currently consumable, for example a purchased package whose validity window has not started yet
- EXPIRED: The package's validity window has ended; any remaining allowance is no longer usable
values
ACTIVENOT_ACTIVEEXPIRED
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
roamingarray of UsageVoicePackageAllowance buckets for calls made while roaming abroad.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
call Secondsintegerint64requiredCall time consumed from this allowance so far, in seconds.
call Countintegerint64requiredNumber of calls placed against this allowance.
call Remaining Secondsintegerint64requiredCall time still available in this allowance, in seconds.
call Total Secondsintegerint64requiredThe full call time allowance of this package, in seconds.
statusenum<string>requiredThe status of this package.
Whether a usage package is currently consumable.
- ACTIVE: The package is in its validity window and usage draws from it
- NOT_ACTIVE: The package exists but is not currently consumable, for example a purchased package whose validity window has not started yet
- EXPIRED: The package's validity window has ended; any remaining allowance is no longer usable
values
ACTIVENOT_ACTIVEEXPIRED
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
ildarray of UsageVoiceIldPackageInternational long distance (ILD) balances for calls placed from the home country to foreign numbers. Tracked as a monetary balance rather than minutes.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this balance. Present only when the balance comes from an add-on.
namestringrequiredHuman-readable name of the package, as shown to end users.
balance Minorintegerint64Remaining prepaid amount available for international long distance calls, in minor units of the currency given by currency. Each ILD call deducts from this balance at the destination's per-minute rate.
currencystringThree-letter ISO 4217 code for the currency the balance is denominated in. Matches the subscription's billing currency.
expiry DatestringdateThe date the remaining balance expires and can no longer be used. Absent when the balance does not expire.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
smsobjectSMS usage across all scopes and packages.
SMS usage for a subscription, split by where and to whom messages are sent: national (domestic messages), roaming (messages sent while abroad), and ILD (international long distance — messages sent from the home country to foreign numbers).
Show child attributes
nationalarray of UsageSmsPackageAllowance buckets for messages sent within the home country, including the base plan's SMS allowance and any add-on packages.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
sms Countintegerint64requiredNumber of messages consumed from this allowance so far.
sms Remainingintegerint64requiredNumber of messages still available in this allowance.
sms Totalintegerint64requiredThe full message allowance of this package.
statusenum<string>requiredThe status of this package.
Whether a usage package is currently consumable.
- ACTIVE: The package is in its validity window and usage draws from it
- NOT_ACTIVE: The package exists but is not currently consumable, for example a purchased package whose validity window has not started yet
- EXPIRED: The package's validity window has ended; any remaining allowance is no longer usable
values
ACTIVENOT_ACTIVEEXPIRED
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
roamingarray of UsageSmsPackageAllowance buckets for messages sent while roaming abroad.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
sms Countintegerint64requiredNumber of messages consumed from this allowance so far.
sms Remainingintegerint64requiredNumber of messages still available in this allowance.
sms Totalintegerint64requiredThe full message allowance of this package.
statusenum<string>requiredThe status of this package.
Whether a usage package is currently consumable.
- ACTIVE: The package is in its validity window and usage draws from it
- NOT_ACTIVE: The package exists but is not currently consumable, for example a purchased package whose validity window has not started yet
- EXPIRED: The package's validity window has ended; any remaining allowance is no longer usable
values
ACTIVENOT_ACTIVEEXPIRED
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
ildarray of UsageSmsPackageAllowance buckets for messages sent from the home country to foreign numbers (international long distance).
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
sms Countintegerint64requiredNumber of messages consumed from this allowance so far.
sms Remainingintegerint64requiredNumber of messages still available in this allowance.
sms Totalintegerint64requiredThe full message allowance of this package.
statusenum<string>requiredThe status of this package.
Whether a usage package is currently consumable.
- ACTIVE: The package is in its validity window and usage draws from it
- NOT_ACTIVE: The package exists but is not currently consumable, for example a purchased package whose validity window has not started yet
- EXPIRED: The package's validity window has ended; any remaining allowance is no longer usable
values
ACTIVENOT_ACTIVEEXPIRED
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
mmsobjectMMS usage across all scopes and packages.
MMS (multimedia message) usage for a subscription, split by where and to whom messages are sent: national (domestic messages), roaming (messages sent while abroad), and ILD (international long distance — messages sent from the home country to foreign numbers).
Show child attributes
nationalarray of UsageMmsPackageAllowance buckets for multimedia messages sent within the home country, including the base plan's MMS allowance and any add-on packages.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
mms Countintegerint64requiredNumber of multimedia messages consumed from this allowance so far.
mms Remainingintegerint64requiredNumber of multimedia messages still available in this allowance.
mms Totalintegerint64requiredThe full multimedia message allowance of this package.
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
roamingarray of UsageMmsPackageAllowance buckets for multimedia messages sent while roaming abroad.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
mms Countintegerint64requiredNumber of multimedia messages consumed from this allowance so far.
mms Remainingintegerint64requiredNumber of multimedia messages still available in this allowance.
mms Totalintegerint64requiredThe full multimedia message allowance of this package.
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
ildarray of UsageMmsPackageAllowance buckets for multimedia messages sent from the home country to foreign numbers (international long distance).
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
mms Countintegerint64requiredNumber of multimedia messages consumed from this allowance so far.
mms Remainingintegerint64requiredNumber of multimedia messages still available in this allowance.
mms Totalintegerint64requiredThe full multimedia message allowance of this package.
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
dataobjectData usage across all scopes and packages.
Mobile data usage for a subscription, split by where the data is consumed: national (used in the home country) and roaming (used while abroad).
Show child attributes
nationalarray of UsageDataNationalPackageAllowance buckets for data used in the home country, including the base plan's data allowance and any add-on packages.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
data Bytes Usedintegerint64requiredData consumed from this allowance so far, in bytes.
data Bytes Remainingintegerint64requiredData still available in this allowance, in bytes.
data Bytes Totalintegerint64requiredThe full data allowance of this package, in bytes.
rlah Bytes Usedintegerint64Data consumed while roaming under RLAH (Roam Like At Home) rules, in bytes. Present only when the package includes an RLAH allowance.
rlah Bytes Remainingintegerint64RLAH data still available, in bytes. Once exhausted, roaming usage may incur additional charges even though national data remains.
rlah Bytes Totalintegerint64The portion of this package usable while roaming under RLAH rules, in bytes. Often lower than the full national allowance.
statusenum<string>requiredThe status of this package.
Whether a usage package is currently consumable.
- ACTIVE: The package is in its validity window and usage draws from it
- NOT_ACTIVE: The package exists but is not currently consumable, for example a purchased package whose validity window has not started yet
- EXPIRED: The package's validity window has ended; any remaining allowance is no longer usable
values
ACTIVENOT_ACTIVEEXPIRED
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
roamingarray of UsageDataRoamingPackageAllowance buckets for data used while roaming abroad, from the base plan's roaming allowance or dedicated roaming add-on packages.
Show child attributes
subscription Addon IdstringThe subscription add-on that granted this allowance. Present only when the package comes from an add-on; absent for the base plan's included roaming allowance.
namestringrequiredHuman-readable name of the package, as shown to end users.
data Bytes Usedintegerint64requiredData consumed from this allowance so far, in bytes.
data Bytes Remainingintegerint64requiredData still available in this allowance, in bytes.
data Bytes Totalintegerint64requiredThe full data allowance of this package, in bytes.
statusenum<string>requiredThe status of this package.
Whether a usage package is currently consumable.
- ACTIVE: The package is in its validity window and usage draws from it
- NOT_ACTIVE: The package exists but is not currently consumable, for example a purchased package whose validity window has not started yet
- EXPIRED: The package's validity window has ended; any remaining allowance is no longer usable
values
ACTIVENOT_ACTIVEEXPIRED
valid Fromstringdate-timeStart of the period this allowance applies to.
valid Tostringdate-timeEnd of the period this allowance applies to. For base plan allowances this is the end of the current billing period (when the allowance resets); for time-limited add-on packages it is when the package itself expires.
metadataobject with string keysA set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format. Provided by API clients and returned as-is; the platform does not interpret the values.
Show child attributes
updated Atstringdate-timerequiredWhen the usage information was last refreshed from the network. Usage counters are not real-time; recent activity may not be reflected yet.
400The request was malformed or invalid.
application/json
The request was malformed or invalid.
The request was malformed or invalid.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
401Authentication is required to access this resource.
application/json
Authentication is required to access this resource.
Authentication is required to access this resource.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
403Access to this resource is forbidden.
application/json
Access to this resource is forbidden.
Access to this resource is forbidden.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
404The requested resource was not found.
application/json
The requested resource was not found.
The requested resource was not found.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
500An unexpected error occurred on the server.
application/json
An unexpected error occurred on the server.
An unexpected error occurred on the server.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
Auth required
Send one of
X-Api-KeyBearer JWT+X-Api-Key
The API key is always required; the bearer token is optional.
curl https://apiv2.example.com/api/v2/subscriptions/SUBSCRIPTION_ID/usage \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'X-Api-Key: YOUR_API_KEY'fetch('https://apiv2.example.com/api/v2/subscriptions/SUBSCRIPTION_ID/usage', {
headers: {
Authorization: 'Bearer YOUR_ACCESS_TOKEN',
'X-Api-Key': 'YOUR_API_KEY'
}
})requests.get(
"https://apiv2.example.com/api/v2/subscriptions/SUBSCRIPTION_ID/usage",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"X-Api-Key": "YOUR_API_KEY"
}
)package main
import (
"fmt"
"io"
"net/http"
)
func main() {
requestUrl := "https://apiv2.example.com/api/v2/subscriptions/SUBSCRIPTION_ID/usage"
req, _ := http.NewRequest("GET", requestUrl, nil)
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Add("X-Api-Key", "YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}{
"voice": {
"national": [
{
"name": "Unlimited National",
"callSeconds": 3600,
"callCount": 15,
"callRemainingSeconds": 32400,
"callTotalSeconds": 36000,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z"
}
],
"ild": [
{
"name": "ILD Top-up",
"balanceMinor": 1550,
"currency": "USD",
"expiryDate": "2025-12-31"
}
]
},
"sms": {
"national": [
{
"name": "500 SMS National",
"smsCount": 25,
"smsRemaining": 475,
"smsTotal": 500,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z"
}
]
},
"data": {
"national": [
{
"name": "10GB National",
"dataBytesUsed": 3221225472,
"dataBytesRemaining": 7516192768,
"dataBytesTotal": 10737418240,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z"
}
],
"roaming": [
{
"name": "Asia 5GB Roaming",
"subscriptionAddonId": "a47ac10b-58cc-4372-a567-0e02b2c3d479",
"dataBytesUsed": 1073741824,
"dataBytesRemaining": 4294967296,
"dataBytesTotal": 5368709120,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z"
}
]
},
"updatedAt": "2025-01-15T10:30:00Z"
}{
"message": "The request body is invalid.",
"code": "bad_request",
"details": [
{
"message": "Email format is invalid.",
"code": "invalid_email",
"property": "contact.email"
}
],
"hint": "Check the request payload and correct the highlighted fields."
}{
"message": "Authentication is required to access this resource.",
"code": "unauthorized",
"hint": "Provide a valid API key in the X-Api-Key header."
}{
"message": "You do not have permission to perform this action.",
"code": "forbidden",
"hint": "Ensure your API key or user has the required permissions."
}{
"message": "The requested customer could not be found.",
"code": "not_found",
"hint": "Verify the customerId and try again."
}{
"message": "An unexpected error occurred on the server.",
"code": "internal_server_error",
"hint": "Retry the request later. If the problem persists, contact support."
}Get usage for multiple subscriptions
/subscriptions/usageRetrieve current usage statistics for multiple subscriptions by providing their IDs.
Query parameters
subscription Idsarray of stringmin items 1max items 100requiredList of subscription IDs to retrieve usage for.
Responses
200Usage statistics for the requested subscriptions.
application/json
Usage statistics for the requested subscriptions.
Usage statistics for the requested subscriptions.
object
itemsarray of objectrequiredUsage information for each requested subscription.
Show child attributes
subscription IdstringrequiredThe unique identifier for the subscription.
usageobjectrequiredCurrent usage statistics for a subscription, organized by service type (voice, SMS, MMS, data). Within each service type, usage is broken down into per-package allowance buckets: the base plan's included allowance plus any add-on packages, each reporting used, remaining, and total amounts. A service type is omitted entirely when the subscription has no allowances of that type.
Show child attributes
voiceobjectVoice call usage across all scopes and packages.
Voice call usage for a subscription, split by where and to whom calls are made: national (domestic calls), roaming (calls made while abroad), and ILD (international long distance — calls placed from the home country to foreign numbers).
Show child attributes
smsobjectSMS usage across all scopes and packages.
SMS usage for a subscription, split by where and to whom messages are sent: national (domestic messages), roaming (messages sent while abroad), and ILD (international long distance — messages sent from the home country to foreign numbers).
Show child attributes
mmsobjectMMS usage across all scopes and packages.
MMS (multimedia message) usage for a subscription, split by where and to whom messages are sent: national (domestic messages), roaming (messages sent while abroad), and ILD (international long distance — messages sent from the home country to foreign numbers).
Show child attributes
dataobjectData usage across all scopes and packages.
Mobile data usage for a subscription, split by where the data is consumed: national (used in the home country) and roaming (used while abroad).
Show child attributes
updated Atstringdate-timerequiredWhen the usage information was last refreshed from the network. Usage counters are not real-time; recent activity may not be reflected yet.
400The request was malformed or invalid.
application/json
The request was malformed or invalid.
The request was malformed or invalid.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
401Authentication is required to access this resource.
application/json
Authentication is required to access this resource.
Authentication is required to access this resource.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
403Access to this resource is forbidden.
application/json
Access to this resource is forbidden.
Access to this resource is forbidden.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
404The requested resource was not found.
application/json
The requested resource was not found.
The requested resource was not found.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
500An unexpected error occurred on the server.
application/json
An unexpected error occurred on the server.
An unexpected error occurred on the server.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringdeprecatedrequiredDeprecated. Use internalCode.
This field mixes three unrelated codes and does not say which one you have: a code that we publish, an operator's own code when the failure came from an operator, or the request status when there is neither. Do not branch on it.
internal CodestringNames the condition that failed, from our own registry. It is independent of which system reported the failure and of the HTTP status, and it is stable across releases. Branch on this field. An unexpected failure on our side can carry no code. Then use the HTTP status.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
Auth required
Send one of
X-Api-KeyBearer JWT+X-Api-Key
The API key is always required; the bearer token is optional.
curl 'https://apiv2.example.com/api/v2/subscriptions/usage?subscriptionIds=SUBSCRIPTION_IDS' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'X-Api-Key: YOUR_API_KEY'fetch('https://apiv2.example.com/api/v2/subscriptions/usage?subscriptionIds=SUBSCRIPTION_IDS', {
headers: {
Authorization: 'Bearer YOUR_ACCESS_TOKEN',
'X-Api-Key': 'YOUR_API_KEY'
}
})requests.get(
"https://apiv2.example.com/api/v2/subscriptions/usage",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"X-Api-Key": "YOUR_API_KEY"
},
params={
"subscriptionIds": "SUBSCRIPTION_IDS"
}
)package main
import (
"fmt"
"io"
"net/http"
)
func main() {
requestUrl := "https://apiv2.example.com/api/v2/subscriptions/usage?subscriptionIds=SUBSCRIPTION_IDS"
req, _ := http.NewRequest("GET", requestUrl, nil)
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Add("X-Api-Key", "YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}{
"items": [
{
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"usage": {
"voice": {
"national": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "Unlimited National",
"callSeconds": 3600,
"callCount": 15,
"callRemainingSeconds": 32400,
"callTotalSeconds": 36000,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
],
"roaming": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "Unlimited National",
"callSeconds": 3600,
"callCount": 15,
"callRemainingSeconds": 32400,
"callTotalSeconds": 36000,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
],
"ild": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "ILD Top-up",
"balanceMinor": 1550,
"currency": "USD",
"expiryDate": "2025-12-31",
"metadata": {
"propertyName": "string"
}
}
]
},
"sms": {
"national": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "500 SMS National",
"smsCount": 25,
"smsRemaining": 475,
"smsTotal": 500,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
],
"roaming": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "500 SMS National",
"smsCount": 25,
"smsRemaining": 475,
"smsTotal": 500,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
],
"ild": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "500 SMS National",
"smsCount": 25,
"smsRemaining": 475,
"smsTotal": 500,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
]
},
"mms": {
"national": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "100 MMS National",
"mmsCount": 10,
"mmsRemaining": 90,
"mmsTotal": 100,
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
],
"roaming": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "100 MMS National",
"mmsCount": 10,
"mmsRemaining": 90,
"mmsTotal": 100,
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
],
"ild": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "100 MMS National",
"mmsCount": 10,
"mmsRemaining": 90,
"mmsTotal": 100,
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
]
},
"data": {
"national": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "10GB National",
"dataBytesUsed": 3221225472,
"dataBytesRemaining": 7516192768,
"dataBytesTotal": 10737418240,
"rlahBytesUsed": 1073741824,
"rlahBytesRemaining": 4294967296,
"rlahBytesTotal": 5368709120,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
],
"roaming": [
{
"subscriptionAddonId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "Asia 5GB Roaming",
"dataBytesUsed": 1073741824,
"dataBytesRemaining": 4294967296,
"dataBytesTotal": 5368709120,
"status": "ACTIVE",
"validFrom": "2025-01-01T00:00:00Z",
"validTo": "2025-02-01T00:00:00Z",
"metadata": {
"propertyName": "string"
}
}
]
},
"updatedAt": "2024-01-15T10:30:00Z"
}
}
]
}{
"message": "The request body is invalid.",
"code": "bad_request",
"details": [
{
"message": "Email format is invalid.",
"code": "invalid_email",
"property": "contact.email"
}
],
"hint": "Check the request payload and correct the highlighted fields."
}{
"message": "Authentication is required to access this resource.",
"code": "unauthorized",
"hint": "Provide a valid API key in the X-Api-Key header."
}{
"message": "You do not have permission to perform this action.",
"code": "forbidden",
"hint": "Ensure your API key or user has the required permissions."
}{
"message": "The requested customer could not be found.",
"code": "not_found",
"hint": "Verify the customerId and try again."
}{
"message": "An unexpected error occurred on the server.",
"code": "internal_server_error",
"hint": "Retry the request later. If the problem persists, contact support."
}