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"
}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.
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
Your project's secret key (pk_…, without the pub segment). Server-side only — never ship it to a browser. Get it from Settings → Projects in the dashboard.
Response
Current-period usage for the owning organization.
ok means web in-app messages are being served. payment_required means billing must be restored before either channel can deliver. cap_reached means usage reached the organization's spend cap for this period.
ok, payment_required, cap_reached Campaign-email serving state. It is paused whenever serving is not ok, and while billing is past_due even though web in-app keeps serving.
ok, paused Whether a payment method is on file.
Show child attributes
Show child attributes
Monthly active users across the organization in this period. An end user counts once per period in each project when identified, tracked, shown a web in-app message, or accepted for campaign email.
12480
Campaign-email deliveries skipped by the recipient frequency limit during the current period, across the organization.
12
Usage cost so far in USD, before tax.
229.76
The organization's spend cap in USD, or null when no cap is set.
250
Monthly active users and frequency-capped campaign-email deliveries per project in this period.
Show child attributes
Show child attributes