Get brick usage for a subscription
curl --request GET \
  --url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage \
  --header 'X-SALESBRICKS-KEY: <api-key>'
{
  "starts_at": "2023-11-07T05:31:56Z",
  "ends_at": "2023-11-07T05:31:56Z",
  "subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "brick_name": "<string>",
  "pre_commitment": 123,
  "used": 123,
  "remaining": 123,
  "unit": "<string>"
}

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Path Parameters

brick_id
string
required
subscription_id
string
required

Query Parameters

currentPeriod
enum<string>

Set to '1' or 'true' to only return usage for the current period.

Available options:
1,
True,
true

Response

200 - application/json
starts_at
string<date-time>
required

The period's start date and time

ends_at
string<date-time>
required

The period's end date and time

subscription_id
string<uuid>
required

The unique identifier of the subscription

brick_id
string<uuid>
required

The unique identifier of the brick within the subscription

brick_name
string
required

The display name of the brick

pre_commitment
integer
required

The pre-committed amount of units for this brick. Will be 0 if no pre-commitment is set.

used
integer
required

The number of units that have been used so far. Calculated as pre_commitment - remaining.

remaining
integer
required

The number of units remaining in the pre-commitment. Can be negative if usage exceeds pre-commitment.

unit
string
required

The unit of measurement for this brick (e.g., 'API calls', 'GB', etc.). Defaults to 'units' if not specified.