curl --request GET \
--url https://dev.api.galtea.ai/reports/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.api.galtea.ai/reports/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.api.galtea.ai/reports/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://dev.api.galtea.ai/reports/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://dev.api.galtea.ai/reports/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://dev.api.galtea.ai/reports/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/reports/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{
"schemaVersion": 1,
"generatedAt": "2023-11-07T05:31:56Z",
"window": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timeZone": "<string>"
},
"scope": {
"kind": "organization",
"organizationId": "<string>"
},
"peopleDetail": "aggregate",
"sources": {
"db": {
"status": "ok",
"reason": "not_configured"
},
"posthog": {
"status": "ok",
"reason": "not_configured"
},
"loki": {
"status": "ok",
"reason": "not_configured"
}
},
"organizations": [
{
"id": "<string>",
"name": "<string>",
"segment": "client",
"dataRegion": "<string>",
"lastActivityAt": "2023-11-07T05:31:56Z",
"flags": [
"first_evaluation"
],
"products": [
{
"id": "<string>",
"name": "<string>",
"lastActivityAt": "2023-11-07T05:31:56Z",
"created": {
"versions": 123,
"tests": 123,
"testCases": 123,
"specifications": 123,
"runs": 123,
"sessions": 123,
"evaluations": 123
},
"sessionsByUser": [
{
"user": {
"userId": "<string>",
"name": "<string>"
},
"count": 123
}
],
"evaluationsByUser": [
{
"user": {
"userId": "<string>",
"name": "<string>"
},
"count": 123
}
]
}
],
"people": [
{
"user": {
"userId": "<string>",
"name": "<string>"
},
"isStaff": true,
"created": {
"versions": 123,
"tests": 123,
"testCases": 123,
"specifications": 123,
"runs": 123,
"sessions": 123,
"evaluations": 123
},
"lastActivityAt": "2023-11-07T05:31:56Z",
"clientTypes": {
"dashboard": 123,
"sdk": 123,
"cli": 123,
"api": 123
}
}
],
"dashboard": {
"visitors": 123,
"sessions": 123,
"pageviews": 123,
"rageClicks": 123,
"errors": 123,
"visitorList": [
{
"visitorRef": "<string>",
"confidence": "identified",
"method": "posthog_identified",
"pageviews": 123,
"user": {
"userId": "<string>",
"name": "<string>"
}
}
]
},
"recordings": [
{
"url": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"activeSeconds": 123,
"durationSeconds": 123,
"confidence": "identified",
"user": {
"userId": "<string>",
"name": "<string>"
}
}
]
}
],
"truncated": {
"organizations": true,
"products": true,
"people": true,
"dashboard": true,
"recordings": true
},
"excluded": {
"organizations": 123,
"staffRows": 123
}
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}Get what organizations created and who worked on the platform in a window
Per organization: what each product created in the window, who created it, and flags such as a first evaluation or a quiet client. Staff rows, soft-deleted rows, seed sessions and demo clones are left out of the counts. posthog and loki add dashboard visits and API client types. A source that is not ok leaves its fields out, never zero. Needs organization.readUsageReport on the organization, plus a cross-organization role without organizationId. format=pdf answers { downloadUrl } instead, and format=both answers { report, downloadUrl }; the PDF is stored under the caller’s organization.
curl --request GET \
--url https://dev.api.galtea.ai/reports/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.api.galtea.ai/reports/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.api.galtea.ai/reports/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://dev.api.galtea.ai/reports/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://dev.api.galtea.ai/reports/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://dev.api.galtea.ai/reports/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/reports/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{
"schemaVersion": 1,
"generatedAt": "2023-11-07T05:31:56Z",
"window": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timeZone": "<string>"
},
"scope": {
"kind": "organization",
"organizationId": "<string>"
},
"peopleDetail": "aggregate",
"sources": {
"db": {
"status": "ok",
"reason": "not_configured"
},
"posthog": {
"status": "ok",
"reason": "not_configured"
},
"loki": {
"status": "ok",
"reason": "not_configured"
}
},
"organizations": [
{
"id": "<string>",
"name": "<string>",
"segment": "client",
"dataRegion": "<string>",
"lastActivityAt": "2023-11-07T05:31:56Z",
"flags": [
"first_evaluation"
],
"products": [
{
"id": "<string>",
"name": "<string>",
"lastActivityAt": "2023-11-07T05:31:56Z",
"created": {
"versions": 123,
"tests": 123,
"testCases": 123,
"specifications": 123,
"runs": 123,
"sessions": 123,
"evaluations": 123
},
"sessionsByUser": [
{
"user": {
"userId": "<string>",
"name": "<string>"
},
"count": 123
}
],
"evaluationsByUser": [
{
"user": {
"userId": "<string>",
"name": "<string>"
},
"count": 123
}
]
}
],
"people": [
{
"user": {
"userId": "<string>",
"name": "<string>"
},
"isStaff": true,
"created": {
"versions": 123,
"tests": 123,
"testCases": 123,
"specifications": 123,
"runs": 123,
"sessions": 123,
"evaluations": 123
},
"lastActivityAt": "2023-11-07T05:31:56Z",
"clientTypes": {
"dashboard": 123,
"sdk": 123,
"cli": 123,
"api": 123
}
}
],
"dashboard": {
"visitors": 123,
"sessions": 123,
"pageviews": 123,
"rageClicks": 123,
"errors": 123,
"visitorList": [
{
"visitorRef": "<string>",
"confidence": "identified",
"method": "posthog_identified",
"pageviews": 123,
"user": {
"userId": "<string>",
"name": "<string>"
}
}
]
},
"recordings": [
{
"url": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"activeSeconds": 123,
"durationSeconds": 123,
"confidence": "identified",
"user": {
"userId": "<string>",
"name": "<string>"
}
}
]
}
],
"truncated": {
"organizations": true,
"products": true,
"people": true,
"dashboard": true,
"recordings": true
},
"excluded": {
"organizations": 123,
"staffRows": 123
}
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Query Parameters
The organization to report on. Omitted reports on every organization, which only a caller that may read across organizations may ask.
1Start of the window, inclusive (ISO 8601).
End of the window, exclusive (ISO 8601). At most 92 days after from, or 31 days when sources holds posthog or loki, else 400.
IANA time zone, only echoed in window so a reader knows which local days from and to meant. It changes no count, flag or bound: send from and to as the local day bounds yourself.
"Europe/Madrid"
Comma-separated sources: db (the application database), posthog (dashboard visits and recordings) and loki (API requests per client type). Default db, which every report reads. posthog and loki need organization.readUsageTelemetry, else 403.
"db,posthog,loki"
How people are shown: names, ids or aggregate (no per-person list). The deployment can cap it lower; peopleDetail in the answer says what applied.
aggregate, ids, names json (default) answers the report. pdf answers { downloadUrl }, the report rendered to a PDF. both answers { report, downloadUrl }. A PDF waits for the report generator, so it takes longer.
json, pdf, both Response
The usage report (format=json), { downloadUrl } (pdf), or { report, downloadUrl } (both)
- Option 1
- Option 2
- Option 3
1 Show child attributes
Show child attributes
Show child attributes
Show child attributes
aggregate, ids, names Show child attributes
Show child attributes
The organization asked for, or every organization with external activity in the window (and every client), most active first, then those only the posthog or loki source saw, at most 1,000. Counts leave out soft-deleted rows, seed sessions, demo clones and rows staff created.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Only for the all scope.
Show child attributes
Show child attributes