Long-format per-user-per-period usage extract
curl --request POST \
--url https://hiimpria.ai/api/admin/histories/charts/user-stats \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"range": -7,
"daterange": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"account": "<string>",
"institution": "<string>",
"usersearch": "<string>"
}
'import requests
url = "https://hiimpria.ai/api/admin/histories/charts/user-stats"
payload = {
"range": -7,
"daterange": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"account": "<string>",
"institution": "<string>",
"usersearch": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
range: -7,
daterange: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
account: '<string>',
institution: '<string>',
usersearch: '<string>'
})
};
fetch('https://hiimpria.ai/api/admin/histories/charts/user-stats', 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://hiimpria.ai/api/admin/histories/charts/user-stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'range' => -7,
'daterange' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'account' => '<string>',
'institution' => '<string>',
'usersearch' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hiimpria.ai/api/admin/histories/charts/user-stats"
payload := strings.NewReader("{\n \"range\": -7,\n \"daterange\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"account\": \"<string>\",\n \"institution\": \"<string>\",\n \"usersearch\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hiimpria.ai/api/admin/histories/charts/user-stats")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"range\": -7,\n \"daterange\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"account\": \"<string>\",\n \"institution\": \"<string>\",\n \"usersearch\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/admin/histories/charts/user-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"range\": -7,\n \"daterange\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"account\": \"<string>\",\n \"institution\": \"<string>\",\n \"usersearch\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"granularity": "day",
"truncated": true,
"windowSource": "daterange",
"defaultDaysApplied": 123,
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"data": [
{
"user": "<string>",
"email": "<string>",
"fname": "<string>",
"lname": "<string>",
"institution": "<string>",
"instanceName": "<string>",
"aiName": "<string>",
"period": "day",
"periodStart": "2023-11-07T05:31:56Z",
"queryCount": 123,
"creditsUsed": 123,
"lifetimeUsed": 123,
"capLimit": 123,
"capSource": "account",
"capUsedPct": 123,
"atCap": true
}
],
"summary": {
"meanCreditsPerUserAccount": 123,
"meanCreditsPerUserInstitution": 123,
"usersAtCap": 123
}
}Admin Histories
Long-format per-user-per-period usage extract
Aggregates query count and credit usage per (user, institution, period) for admin reporting / CSV export. One row per non-zero usage bucket. Capped at 5000 rows; the response sets truncated: true when the cap is reached. Excludes histories that the user has flagged as forgotten.
POST
/
api
/
admin
/
histories
/
charts
/
user-stats
Long-format per-user-per-period usage extract
curl --request POST \
--url https://hiimpria.ai/api/admin/histories/charts/user-stats \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"range": -7,
"daterange": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"account": "<string>",
"institution": "<string>",
"usersearch": "<string>"
}
'import requests
url = "https://hiimpria.ai/api/admin/histories/charts/user-stats"
payload = {
"range": -7,
"daterange": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"account": "<string>",
"institution": "<string>",
"usersearch": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
range: -7,
daterange: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
account: '<string>',
institution: '<string>',
usersearch: '<string>'
})
};
fetch('https://hiimpria.ai/api/admin/histories/charts/user-stats', 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://hiimpria.ai/api/admin/histories/charts/user-stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'range' => -7,
'daterange' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'account' => '<string>',
'institution' => '<string>',
'usersearch' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hiimpria.ai/api/admin/histories/charts/user-stats"
payload := strings.NewReader("{\n \"range\": -7,\n \"daterange\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"account\": \"<string>\",\n \"institution\": \"<string>\",\n \"usersearch\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hiimpria.ai/api/admin/histories/charts/user-stats")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"range\": -7,\n \"daterange\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"account\": \"<string>\",\n \"institution\": \"<string>\",\n \"usersearch\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/admin/histories/charts/user-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"range\": -7,\n \"daterange\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"account\": \"<string>\",\n \"institution\": \"<string>\",\n \"usersearch\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"granularity": "day",
"truncated": true,
"windowSource": "daterange",
"defaultDaysApplied": 123,
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"data": [
{
"user": "<string>",
"email": "<string>",
"fname": "<string>",
"lname": "<string>",
"institution": "<string>",
"instanceName": "<string>",
"aiName": "<string>",
"period": "day",
"periodStart": "2023-11-07T05:31:56Z",
"queryCount": 123,
"creditsUsed": 123,
"lifetimeUsed": 123,
"capLimit": 123,
"capSource": "account",
"capUsedPct": 123,
"atCap": true
}
],
"summary": {
"meanCreditsPerUserAccount": 123,
"meanCreditsPerUserInstitution": 123,
"usersAtCap": 123
}
}Body
application/json
Response
Successful aggregation
Was this page helpful?