curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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>",
"brick_code": "<string>",
"pre_commitment": 123,
"used": 0,
"overages": 0,
"remaining": 0,
"unit": "<string>",
"overage_rate": "<string>",
"pre_commitment_schedule": "ALL_UPFRONT"
}Retrieve brick usage
Returns detailed usage metrics for a specific brick within a subscription, including pre-commitment amounts, used quantities, and remaining units. The remaining value can be negative if usage exceeds the pre-commitment amount. If no pre-commitment is set, pre_commitment and remaining will be 0. For pool bricks (usage aggregators), overages and overage_rate will always be 0/null; overage information appears on the individual bricks that contribute to the pool. By default, returns all historical periods. Use query parameters to filter results.
curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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>",
"brick_code": "<string>",
"pre_commitment": 123,
"used": 0,
"overages": 0,
"remaining": 0,
"unit": "<string>",
"overage_rate": "<string>",
"pre_commitment_schedule": "ALL_UPFRONT"
}Path Parameters
Query Parameters
Filter periods ending before this date. To include periods ending on a specific date, specify the following day. Accepts ISO 8601 format (e.g., '2024-12-31' or '2024-12-31T23:59:59'). Date-only values are interpreted in the system timezone. Example: to=2025-05-01 includes periods through April 30.
Response
Brick utilization serializer for utilization API.
The number of units that exceeded the pre-commitment. Returns an integer for whole number quantities or a decimal for fractional usage. Will be 0 if usage has not exceeded pre-commitment, if no pre-commitment is set, or if this is a pool brick (overages only appear on the individual bricks, not on the pool itself).
-100000000000000 < x < 100000000000000The cost per overage unit. Multiply overages * overage_rate to get total overage cost. Will be null if no overages, no overage pricing configured, or if this is a pool brick (overage rates only appear on the individual bricks, not on the pool itself).
^-?\d{0,10}(?:\.\d{0,10})?$