> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.getunleash.io/api/get-instance-admin-stats/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getunleash.io/_mcp/server. # Get instance statistics GET https://app.unleash-instance.example.com/api/admin/instance-admin/statistics Provides statistics about various features of Unleash to allow for reporting of usage for self-hosted customers. The response contains data such as the number of users, groups, features, strategies, versions, etc. Reference: https://docs.getunleash.io/api/get-instance-admin-stats ## Authentication - `Authorization` header (required) — API key needed to access this API - `Authorization` header (bearer token, required) — API key needed to access this API, in Bearer token format ## Response ### 200 instanceAdminStatsSchema - `instanceId` (string, required) — A unique identifier for this instance. Generated by the database migration scripts at first run. Typically a UUID. - `timestamp` (string, optional, nullable) — When these statistics were produced - `versionOSS` (string, optional) — The version of Unleash OSS that is bundled in this instance - `versionEnterprise` (string, optional) — The version of Unleash Enterprise that is bundled in this instance - `users` (integer, optional) — The number of users this instance has - `previousDayMetricsBucketsCount` (InstanceAdminStatsSchemaPreviousDayMetricsBucketsCount, optional) — The number client metrics buckets records recorded in the previous day. # features * # apps * # envs * # hours with metrics - `activeUsers` (InstanceAdminStatsSchemaActiveUsers, optional) — The number of active users in the last 7, 30 and 90 days - `licensedUsers` (integer, optional) — The number of users who had access to Unleash within the last 30 days, including those who may have been deleted during this period. - `productionChanges` (InstanceAdminStatsSchemaProductionChanges, optional) — The number of changes to the production environment in the last 30, 60 and 90 days - `featureToggles` (integer, optional) — The number of feature-toggles this instance has - `projects` (integer, optional) — The number of projects defined in this instance. - `contextFields` (integer, optional) — The number of context fields defined in this instance. - `roles` (integer, optional) — The number of roles defined in this instance - `groups` (integer, optional) — The number of groups defined in this instance - `environments` (integer, optional) — The number of environments defined in this instance - `segments` (integer, optional) — The number of segments defined in this instance - `strategies` (integer, optional) — The number of strategies defined in this instance - `SAMLenabled` (boolean, optional) — Whether or not SAML authentication is enabled for this instance - `OIDCenabled` (boolean, optional) — Whether or not OIDC authentication is enabled for this instance - `clientApps` (list of InstanceAdminStatsSchemaClientAppsItems, optional) — A count of connected applications in the last week, last month and all time since last restart - `featureExports` (integer, optional) — The number of export operations on this instance - `featureImports` (integer, optional) — The number of import operations on this instance - `apiTokens` (InstanceAdminStatsSchemaApiTokens, optional) — The number of API tokens in Unleash, split by type - `maxEnvironmentStrategies` (integer, optional) — The highest number of strategies used on a single feature flag in a single environment. - `maxConstraints` (integer, optional) — The highest number of constraints used on a single strategy. - `maxConstraintValues` (integer, optional) — The highest number of constraint values used on a single constraint. - `releaseTemplates` (integer, optional) — The number of release templates in this instance - `releasePlans` (integer, optional) — The number of release plans in this instance - `edgeInstanceUsage` (map from string to double, optional) — The average number of edge instances, per month, in the last 12 months, rounded to 3 decimal places - `readOnlyUsers` (integer, optional) — The number of ReadOnly users in this instance - `sum` (string, optional) — A SHA-256 checksum of the instance statistics to be used to verify that the data in this object has not been tampered with ## Types ### InstanceAdminStatsSchemaPreviousDayMetricsBucketsCount The number client metrics buckets records recorded in the previous day. # features * # apps * # envs * # hours with metrics - `enabledCount` (integer, optional) — The number of enabled/disabled metrics buckets recorded in the previous day - `variantCount` (integer, optional) — The number of variant metrics buckets recorded in the previous day ### InstanceAdminStatsSchemaActiveUsers The number of active users in the last 7, 30 and 90 days - `last7` (integer, optional) — The number of active users in the last 7 days - `last30` (integer, optional) — The number of active users in the last 30 days - `last60` (integer, optional) — The number of active users in the last 60 days - `last90` (integer, optional) — The number of active users in the last 90 days ### InstanceAdminStatsSchemaProductionChanges The number of changes to the production environment in the last 30, 60 and 90 days - `last30` (integer, optional) — The number of changes in production in the last 30 days - `last60` (integer, optional) — The number of changes in production in the last 60 days - `last90` (integer, optional) — The number of changes in production in the last 90 days ### InstanceAdminStatsSchemaClientAppsItems An entry describing how many client applications has been observed over the defined range - `range` (enum, optional) — A description of a time range - Allowed values: `allTime`, `30d`, `7d` - `count` (integer, optional) — The number of client applications that have been observed in this period ### InstanceAdminStatsSchemaApiTokens The number of API tokens in Unleash, split by type - `admin` (integer, optional) — The number of admin tokens. - `client` (integer, optional) — The number of client tokens. - `frontend` (integer, optional) — The number of frontend tokens. ## Examples **Response** ```json { "instanceId": "ed3861ae-78f9-4e8c-8e57-b57efc15f82b", "timestamp": "2023-06-12T12:25:06Z", "versionOSS": "5.1.7", "versionEnterprise": "5.1.7", "users": 8, "previousDayMetricsBucketsCount": { "enabledCount": 10, "variantCount": 10 }, "activeUsers": { "last7": 5, "last30": 10, "last60": 12, "last90": 15 }, "licensedUsers": 10, "productionChanges": { "last30": 10, "last60": 12, "last90": 15 }, "featureToggles": 47, "projects": 3, "contextFields": 7, "roles": 5, "groups": 12, "environments": 3, "segments": 19, "strategies": 8, "SAMLenabled": false, "OIDCenabled": true, "clientApps": [ { "range": "30d", "count": 1 } ], "featureExports": 0, "featureImports": 0, "apiTokens": { "admin": 5, "client": 5, "frontend": 5 }, "maxEnvironmentStrategies": 3, "maxConstraints": 4, "maxConstraintValues": 17, "releaseTemplates": 2, "releasePlans": 1, "edgeInstanceUsage": { "2024-10": 0.45, "2025-08": 1.75, "2025-09": 2.25 }, "readOnlyUsers": 1, "sum": "b023323477abb1eb145bebf3cdb30a1c2063e3edc1f7ae474ed8ed6c80de9a3b" } ``` **SDK Code** ```python import requests url = "https://app.unleash-instance.example.com/api/admin/instance-admin/statistics" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/instance-admin/statistics'; const options = {method: 'GET', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/admin/instance-admin/statistics" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.unleash-instance.example.com/api/admin/instance-admin/statistics") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.unleash-instance.example.com/api/admin/instance-admin/statistics") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/instance-admin/statistics', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/instance-admin/statistics"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/admin/instance-admin/statistics")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```