curl --request GET \
--url https://api.paywithlocus.com/api/credits/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywithlocus.com/api/credits/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywithlocus.com/api/credits/analytics', 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.paywithlocus.com/api/credits/analytics",
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://api.paywithlocus.com/api/credits/analytics"
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://api.paywithlocus.com/api/credits/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/analytics")
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{
"success": true,
"analytics": {
"days": 7,
"bucket": "hour",
"filter": {
"initiator": {
"type": "oauth_member",
"id": "<string>"
},
"provider": "<string>",
"endpoint": "<string>"
},
"timezone": "UTC",
"periodStart": "2023-11-07T05:31:56Z",
"periodEndExclusive": "2023-11-07T05:31:56Z",
"priorPeriodStart": "2023-11-07T05:31:56Z",
"priorPeriodEndExclusive": "2023-11-07T05:31:56Z",
"summary": {
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
},
"priorSummary": {
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
},
"series": [
{
"start": "2023-11-07T05:31:56Z",
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
}
],
"daily": [
{
"date": "2023-12-25",
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
}
],
"services": [
{
"provider": "<string>",
"endpoint": "<string>",
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1,
"spenders": 1
}
],
"providers": [
{
"provider": "<string>",
"spenders": 123,
"endpoints": 123,
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
}
],
"users": [
{
"externalUserId": "<string>",
"usageUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1
}
],
"initiators": [
{
"type": "oauth_member",
"initiatorId": "<string>",
"label": "<string>",
"authMethod": "<string>",
"clients": [
"<string>"
],
"usageUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 123,
"providers": 123
}
],
"usageDrift": {
"mode": "shadow",
"attributionCoverageRequired": "<string>",
"currentWindowDays": 123,
"baselineWindowDays": 123,
"collecting": 1,
"active": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"feature": "<string>",
"appVersion": "<string>",
"status": "SHADOW",
"severity": "INFO",
"mode": "shadow",
"coverageRatio": "<string>",
"baselineSamples": 1,
"currentSamples": 1,
"requiredSamples": 1,
"baseline": {},
"current": {},
"percentageChange": "<string>",
"adjustedPValue": "<string>",
"contributors": {},
"lastEvaluatedAt": "2023-11-07T05:31:56Z",
"ledgerFilterPath": "<string>",
"informational": true,
"firstSeenAt": "2023-11-07T05:31:56Z",
"detectedAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z"
}
],
"recentResolved": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"feature": "<string>",
"appVersion": "<string>",
"status": "SHADOW",
"severity": "INFO",
"mode": "shadow",
"coverageRatio": "<string>",
"baselineSamples": 1,
"currentSamples": 1,
"requiredSamples": 1,
"baseline": {},
"current": {},
"percentageChange": "<string>",
"adjustedPValue": "<string>",
"contributors": {},
"lastEvaluatedAt": "2023-11-07T05:31:56Z",
"ledgerFilterPath": "<string>",
"informational": true,
"firstSeenAt": "2023-11-07T05:31:56Z",
"detectedAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z"
}
]
}
}
}Tenant usage analytics
Exact database rollups over captured BURN debits. Accepts either the legacy days=7|30|90 form or an explicit half-open from/to window, optionally bucketed and narrowed to one spender and/or one provider. The prior comparison covers the same elapsed span as the current period, including today’s partial UTC day, and is narrowed by the same filter so deltas stay like-for-like; top-ups, allocations, refunds, and open reservations are excluded. usageDrift is null when the optional detector read is temporarily unavailable.
curl --request GET \
--url https://api.paywithlocus.com/api/credits/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywithlocus.com/api/credits/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywithlocus.com/api/credits/analytics', 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.paywithlocus.com/api/credits/analytics",
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://api.paywithlocus.com/api/credits/analytics"
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://api.paywithlocus.com/api/credits/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/analytics")
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{
"success": true,
"analytics": {
"days": 7,
"bucket": "hour",
"filter": {
"initiator": {
"type": "oauth_member",
"id": "<string>"
},
"provider": "<string>",
"endpoint": "<string>"
},
"timezone": "UTC",
"periodStart": "2023-11-07T05:31:56Z",
"periodEndExclusive": "2023-11-07T05:31:56Z",
"priorPeriodStart": "2023-11-07T05:31:56Z",
"priorPeriodEndExclusive": "2023-11-07T05:31:56Z",
"summary": {
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
},
"priorSummary": {
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
},
"series": [
{
"start": "2023-11-07T05:31:56Z",
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
}
],
"daily": [
{
"date": "2023-12-25",
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
}
],
"services": [
{
"provider": "<string>",
"endpoint": "<string>",
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1,
"spenders": 1
}
],
"providers": [
{
"provider": "<string>",
"spenders": 123,
"endpoints": 123,
"usageUsdc": "<string>",
"baseUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1,
"activeUsers": 1
}
],
"users": [
{
"externalUserId": "<string>",
"usageUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 1
}
],
"initiators": [
{
"type": "oauth_member",
"initiatorId": "<string>",
"label": "<string>",
"authMethod": "<string>",
"clients": [
"<string>"
],
"usageUsdc": "<string>",
"marginUsdc": "<string>",
"calls": 123,
"providers": 123
}
],
"usageDrift": {
"mode": "shadow",
"attributionCoverageRequired": "<string>",
"currentWindowDays": 123,
"baselineWindowDays": 123,
"collecting": 1,
"active": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"feature": "<string>",
"appVersion": "<string>",
"status": "SHADOW",
"severity": "INFO",
"mode": "shadow",
"coverageRatio": "<string>",
"baselineSamples": 1,
"currentSamples": 1,
"requiredSamples": 1,
"baseline": {},
"current": {},
"percentageChange": "<string>",
"adjustedPValue": "<string>",
"contributors": {},
"lastEvaluatedAt": "2023-11-07T05:31:56Z",
"ledgerFilterPath": "<string>",
"informational": true,
"firstSeenAt": "2023-11-07T05:31:56Z",
"detectedAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z"
}
],
"recentResolved": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"feature": "<string>",
"appVersion": "<string>",
"status": "SHADOW",
"severity": "INFO",
"mode": "shadow",
"coverageRatio": "<string>",
"baselineSamples": 1,
"currentSamples": 1,
"requiredSamples": 1,
"baseline": {},
"current": {},
"percentageChange": "<string>",
"adjustedPValue": "<string>",
"contributors": {},
"lastEvaluatedAt": "2023-11-07T05:31:56Z",
"ledgerFilterPath": "<string>",
"informational": true,
"firstSeenAt": "2023-11-07T05:31:56Z",
"detectedAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z"
}
]
}
}
}Authorizations
Locus Pro dashboard session (Cognito).
Query Parameters
Legacy form: N whole UTC days ending with today so far. Cannot be combined with from/to. Any value outside the enum — including a repeated parameter — is a 400 rather than a silent fall back to the default.
7, 30, 90 Window start, inclusive. Strict ISO-8601 (must round-trip). Requires to. Must be on or after 2000-01-01T00:00:00.000Z.
Window end, EXCLUSIVE. Strict ISO-8601. Requires from, must be later than it, and may not be more than 24 hours ahead of the server clock. A window ending in the future gap-fills its trailing buckets with zeros.
Series granularity, aligned to UTC calendar boundaries (weeks start Monday). A window yielding more than 400 buckets is rejected.
hour, day, week, month Spender reference :, where type is one of oauth_member, end_user, agent_connection, credential, unattributed. The id is the identity analytics ranks by (external user id, Cognito sub, agent-connection id, or API key id); unattributed takes no id.
Provider label as analytics reports it, including the literal 'Unknown service' for burns whose provider was never captured.
Endpoint name. Requires provider.
Row cap applied to services, providers, users, and initiators.
1 <= x <= 100