Get current usage and serving state
curl --request GET \
--url https://galinum.com/api/v1/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://galinum.com/api/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://galinum.com/api/v1/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://galinum.com/api/v1/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 => [
"Authorization: Bearer <token>"
],
]);
$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://galinum.com/api/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://galinum.com/api/v1/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"serving": "ok",
"emailServing": "ok",
"billable": true,
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"boundary": "subscription"
},
"activeUsers": 12480,
"frequencyCapped": 12,
"estimatedSpendUsd": 229.76,
"spendCapUsd": 250,
"projects": [
{
"id": "<string>",
"name": "<string>",
"activeUsers": 123,
"frequencyCapped": 123
}
]
}{
"error": "Unauthorized"
}{
"error": "Too many requests"
}{
"error": "Could not identify user"
}Usage
Get current usage and serving state
Reports the organization’s usage for the current billing period and whether each channel is serving. Check serving before diagnosing web in-app delivery and emailServing before launching or diagnosing campaign email. Billing and spend-cap changes are human actions in the dashboard.
GET
/
api
/
v1
/
usage
Get current usage and serving state
curl --request GET \
--url https://galinum.com/api/v1/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://galinum.com/api/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://galinum.com/api/v1/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://galinum.com/api/v1/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 => [
"Authorization: Bearer <token>"
],
]);
$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://galinum.com/api/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://galinum.com/api/v1/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"serving": "ok",
"emailServing": "ok",
"billable": true,
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"boundary": "subscription"
},
"activeUsers": 12480,
"frequencyCapped": 12,
"estimatedSpendUsd": 229.76,
"spendCapUsd": 250,
"projects": [
{
"id": "<string>",
"name": "<string>",
"activeUsers": 123,
"frequencyCapped": 123
}
]
}{
"error": "Unauthorized"
}{
"error": "Too many requests"
}{
"error": "Could not identify user"
}Authorizations
secretKeyhostedAgentKey
Response
Current-period usage for the owning organization.