Get system usage info.
curl --request GET \
--url https://{tenant}/api/system/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/system/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/system/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://{tenant}/api/system/stats",
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://{tenant}/api/system/stats"
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://{tenant}/api/system/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/system/stats")
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{
"message": "<string>",
"stats": {
"apis": [
{
"avg_active_usage": 13,
"avg_usage": 15,
"date": "2023-07-01",
"license_entitlement": 25,
"license_entitlement_active": 20,
"max_active_usage": 18,
"max_usage": 20,
"min_active_usage": 8,
"min_usage": 10
}
],
"dataplanes": [
{
"avg_active_usage": 13,
"avg_usage": 15,
"date": "2023-07-01",
"license_entitlement": 25,
"license_entitlement_active": 20,
"max_active_usage": 18,
"max_usage": 20,
"min_active_usage": 8,
"min_usage": 10
}
],
"dataplanes_gateways": [
{
"avg_active_usage": 13,
"avg_usage": 15,
"date": "2023-07-01",
"license_entitlement": 25,
"license_entitlement_active": 20,
"max_active_usage": 18,
"max_usage": 20,
"min_active_usage": 8,
"min_usage": 10
}
]
},
"status": "Success"
}{
"Message": "Request validation failed.",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/system/stats",
"Meta": null,
"Status": "Error"
}{
"Message": "Stats not found.",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to system stats.",
"Meta": null,
"Status": "Error"
}System
Get system usage info.
Get system usage info with license entitlements for a specified date range. Return history for current and previous year if no date query parameters are provided.
GET
/
api
/
system
/
stats
Get system usage info.
curl --request GET \
--url https://{tenant}/api/system/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/system/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/system/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://{tenant}/api/system/stats",
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://{tenant}/api/system/stats"
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://{tenant}/api/system/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/system/stats")
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{
"message": "<string>",
"stats": {
"apis": [
{
"avg_active_usage": 13,
"avg_usage": 15,
"date": "2023-07-01",
"license_entitlement": 25,
"license_entitlement_active": 20,
"max_active_usage": 18,
"max_usage": 20,
"min_active_usage": 8,
"min_usage": 10
}
],
"dataplanes": [
{
"avg_active_usage": 13,
"avg_usage": 15,
"date": "2023-07-01",
"license_entitlement": 25,
"license_entitlement_active": 20,
"max_active_usage": 18,
"max_usage": 20,
"min_active_usage": 8,
"min_usage": 10
}
],
"dataplanes_gateways": [
{
"avg_active_usage": 13,
"avg_usage": 15,
"date": "2023-07-01",
"license_entitlement": 25,
"license_entitlement_active": 20,
"max_active_usage": 18,
"max_usage": 20,
"min_active_usage": 8,
"min_usage": 10
}
]
},
"status": "Success"
}{
"Message": "Request validation failed.",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/system/stats",
"Meta": null,
"Status": "Error"
}{
"Message": "Stats not found.",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to system stats.",
"Meta": null,
"Status": "Error"
}Authorizations
The Tyk Dashboard API Access Credentials
Query Parameters
start date
end date
Resolve daily.
Available options:
day The entity for which stats should be retrieved.
Available options:
apis, dataplanes, dataplanes.gateways Was this page helpful?
⌘I