Usage Balances
A usage balance represent the amount of usage consumed from an Allowance for a given Subscription in a certain Period.
Properties
- Name
- object
- Type
- string
- Description
Type of object is always
usageBalance.Allowed values:usageBalance
- Name
- id
- Type
- string
- Description
Unique identifier for the usage balance.
Example:"ubl_0V9n0zo90CE0NuvcsN0j88"
- Name
- allowance
- Type
- Allowance
- Description
- The Allowance this usage balance is tracking.
- Name
- subscription
- Type
- string
- Description
Unique identifier of the Subscription the usage balance is related to.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
- Name
- source
- Type
- UsageBalanceSource
- Description
- The entity providing the allowance to the Subscription.Example:
{"type":"subscriptionPeriod","subscriptionPeriod":4,"subscriptionAddon":null},{"type":"subscriptionAddon","subscriptionPeriod":null,"subscriptionAddon":"sad_0SNlurA049MEWV2UNWPbDfW5B40U"}- Name
- type
- Type
- string
- Description
The entity type providing the allowance.
Allowed values:subscriptionPeriodsubscriptionAddon
- Name
- subscriptionPeriod
- Type
- nullable integer
- Description
When the allowance is provided by the subscription's plan, the subscription period this usage balance is bound by.
Optional: This property may not always be included.Example:4
- Name
- subscriptionAddon
- Type
- nullable string
- Description
When the allowance is provided by a Subscription Add-on, the subscription add-on this usage balance is provided by.
Optional: This property may not always be included.Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
- Name
- unit
- Type
- string
- Description
The unit the usage is counted in.
Allowed values:bytessecondsmessages
- Name
- used
- Type
- integer
- Description
The amount of usage consumed, counted in
unit.Example:230
- Name
- limit
- Type
- nullable integer
- Description
The amount of usage permitted by the associated allowance counted in
unit. A value ofnullindicates an unlimited allowance.Example:500
- Name
- remaining
- Type
- nullable integer
- Description
The amount remaining that can still be consumed, counted in
unit. A value ofnullindicates an unlimited allowance.Example:270
- Name
- usedPercent
- Type
- nullable integer
- Description
The percent of
limitthat has been used. A value ofnullindicates an unlimited allowance.Example:46
- Name
- remainingPercent
- Type
- nullable integer
- Description
The percent of
limitthat has not been used. A value ofnullindicates an unlimited allowance.Example:54
- Name
- usableFrom
- Type
- string
- Description
Timestamp representing the beginning of this usage balance's validity.
Example:"2026-01-03T13:41:24Z"
- Name
- usableUntil
- Type
- string
- Description
Timestamp representing the end of this usage balance's validity.
Example:"2026-02-03T13:41:24Z"
Example
{
"object": "usageBalance",
"id": "ubl_0V9n0zo90CE0NuvcsN0j88",
"allowance": {
"object": "allowance",
"name": "Long distance calls while roaming in Germany",
"type": "data",
"coverage": {
"object": "coverage",
"id": "de",
"countries": [
"DE",
"FR",
"US"
],
"name": "Europe"
},
"limit": 500,
"unit": "bytes"
},
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"source": {
"type": "subscriptionPeriod",
"subscriptionPeriod": 4,
"subscriptionAddon": null
},
"unit": "bytes",
"used": 230,
"limit": 500,
"remaining": 270,
"usedPercent": 46,
"remainingPercent": 54,
"usableFrom": "2026-01-03T13:41:24Z",
"usableUntil": "2026-02-03T13:41:24Z"
}
List all usage balances
Returns a list of usage balances for the given project. The list can be filtered by subscription, subscription period, or subscription add-on. This currently only returns dummy data.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required
Query Parameters
- Name
- subscription
- Type
- string
- Description
Filter usage balances by Subscription ID.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
- Name
- subscriptionPeriod
- Type
- string
- Description
Filter usage balances by subscription period. Requires the
subscriptionparameter. Accepts a positive integer, the special valuecurrent, or a negative integer to request previous periods (e.g.,-1for the previous period). Cannot be combined withsubscriptionAddon.Example:"current"
- Name
- subscriptionAddon
- Type
- string
- Description
Filter usage balances by Subscription Add-on ID. Can be combined with
subscriptionbut not withsubscriptionPeriod.Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
Responses
Returns a list of usage balances.
- Name
- object
- Type
- string
- Description
Type of object is always
list.Allowed values:list
- Name
- items
- Type
- array
- Description
- List of objects of type `usageBalance`.
- Name
- moreItemsAfter
- Type
- nullable string
- Description
A unique identifier to be used as
afterpagination parameter if more items are available sorted after the current batch of items.
- Name
- moreItemsBefore
- Type
- nullable string
- Description
A unique identifier to be used as
beforepagination parameter if more items are available sorted before the current batch of items.
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/usageBalances \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Responses
{
"object": "list",
"items": [
{
"object": "usageBalance",
"id": "ubl_0V9n0zo90CE0NuvcsN0j88",
"allowance": {
"object": "allowance",
"name": "Long distance calls while roaming in Germany",
"type": "data",
"coverage": {
"object": "coverage",
"id": "de",
"countries": [
"DE",
"FR",
"US"
],
"name": "Europe"
},
"limit": 500,
"unit": "bytes"
},
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"source": {
"type": "subscriptionPeriod",
"subscriptionPeriod": 4,
"subscriptionAddon": null
},
"unit": "bytes",
"used": 230,
"limit": 500,
"remaining": 270,
"usedPercent": 46,
"remainingPercent": 54,
"usableFrom": "2026-01-03T13:41:24Z",
"usableUntil": "2026-02-03T13:41:24Z"
}
],
"moreItemsAfter": null,
"moreItemsBefore": null
}
Retrieve a usage balance
Returns the details of an existing usage balance. This currently only returns dummy data.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
- usageBalance
- Type
- string
- Description
The unique identifier for the usage balance.
Example:"ubl_0V9n0zo90CE0NuvcsN0j88"
required
Responses
Returns the usage balance.
- Name
- object
- Type
- string
- Description
Type of object is always
usageBalance.Allowed values:usageBalance
- Name
- id
- Type
- string
- Description
Unique identifier for the usage balance.
Example:"ubl_0V9n0zo90CE0NuvcsN0j88"
- Name
- allowance
- Type
- Allowance
- Description
- The Allowance this usage balance is tracking.
- Name
- subscription
- Type
- string
- Description
Unique identifier of the Subscription the usage balance is related to.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
- Name
- source
- Type
- UsageBalanceSource
- Description
- The entity providing the allowance to the Subscription.Example:
{"type":"subscriptionPeriod","subscriptionPeriod":4,"subscriptionAddon":null},{"type":"subscriptionAddon","subscriptionPeriod":null,"subscriptionAddon":"sad_0SNlurA049MEWV2UNWPbDfW5B40U"}- Name
- type
- Type
- string
- Description
The entity type providing the allowance.
Allowed values:subscriptionPeriodsubscriptionAddon
- Name
- subscriptionPeriod
- Type
- nullable integer
- Description
When the allowance is provided by the subscription's plan, the subscription period this usage balance is bound by.
Optional: This property may not always be included.Example:4
- Name
- subscriptionAddon
- Type
- nullable string
- Description
When the allowance is provided by a Subscription Add-on, the subscription add-on this usage balance is provided by.
Optional: This property may not always be included.Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
- Name
- unit
- Type
- string
- Description
The unit the usage is counted in.
Allowed values:bytessecondsmessages
- Name
- used
- Type
- integer
- Description
The amount of usage consumed, counted in
unit.Example:230
- Name
- limit
- Type
- nullable integer
- Description
The amount of usage permitted by the associated allowance counted in
unit. A value ofnullindicates an unlimited allowance.Example:500
- Name
- remaining
- Type
- nullable integer
- Description
The amount remaining that can still be consumed, counted in
unit. A value ofnullindicates an unlimited allowance.Example:270
- Name
- usedPercent
- Type
- nullable integer
- Description
The percent of
limitthat has been used. A value ofnullindicates an unlimited allowance.Example:46
- Name
- remainingPercent
- Type
- nullable integer
- Description
The percent of
limitthat has not been used. A value ofnullindicates an unlimited allowance.Example:54
- Name
- usableFrom
- Type
- string
- Description
Timestamp representing the beginning of this usage balance's validity.
Example:"2026-01-03T13:41:24Z"
- Name
- usableUntil
- Type
- string
- Description
Timestamp representing the end of this usage balance's validity.
Example:"2026-02-03T13:41:24Z"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/usageBalances/{usageBalance} \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Responses
{
"object": "usageBalance",
"id": "ubl_0V9n0zo90CE0NuvcsN0j88",
"allowance": {
"object": "allowance",
"name": "Long distance calls while roaming in Germany",
"type": "data",
"coverage": {
"object": "coverage",
"id": "de",
"countries": [
"DE",
"FR",
"US"
],
"name": "Europe"
},
"limit": 500,
"unit": "bytes"
},
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"source": {
"type": "subscriptionPeriod",
"subscriptionPeriod": 4,
"subscriptionAddon": "sad_0SNlurA049MEWV2UNWPbDfW5B40U"
},
"unit": "bytes",
"used": 230,
"limit": 500,
"remaining": 270,
"usedPercent": 46,
"remainingPercent": 54,
"usableFrom": "2026-01-03T13:41:24Z",
"usableUntil": "2026-02-03T13:41:24Z"
}