Query usage rollups (API key)
curl --request GET \
--url https://api.monigo.co/v1/usage \
--header 'Authorization: <api-key>'import requests
url = "https://api.monigo.co/v1/usage"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.monigo.co/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://api.monigo.co/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: <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.monigo.co/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.monigo.co/v1/usage")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monigo.co/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 123,
"rollups": [
{
"aggregation": "<string>",
"created_at": "<string>",
"customer_id": "<string>",
"event_count": 123,
"id": "<string>",
"is_test": true,
"last_event_at": "<string>",
"metric_id": "<string>",
"org_id": "<string>",
"period_end": "<string>",
"period_start": "<string>",
"updated_at": "<string>",
"value": 123
}
]
}{}{}{}{}usage
Query usage rollups (API key)
Returns per-customer, per-metric usage rollups for the organisation scoped to the API key, with optional filters.
GET
/
v1
/
usage
Query usage rollups (API key)
curl --request GET \
--url https://api.monigo.co/v1/usage \
--header 'Authorization: <api-key>'import requests
url = "https://api.monigo.co/v1/usage"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.monigo.co/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://api.monigo.co/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: <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.monigo.co/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.monigo.co/v1/usage")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monigo.co/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 123,
"rollups": [
{
"aggregation": "<string>",
"created_at": "<string>",
"customer_id": "<string>",
"event_count": 123,
"id": "<string>",
"is_test": true,
"last_event_at": "<string>",
"metric_id": "<string>",
"org_id": "<string>",
"period_end": "<string>",
"period_start": "<string>",
"updated_at": "<string>",
"value": 123
}
]
}{}{}{}{}Authorizations
API key with Bearer prefix (for programmatic/server-to-server access), format: Bearer {api_key}
Query Parameters
Filter by customer ID
Filter by metric ID (UUID)
Period start lower bound (RFC3339). Defaults to start of current billing period.
Period start upper bound, exclusive (RFC3339). Defaults to end of current billing period.
⌘I

