# 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 ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Instance usage statistics version: endpoint_instanceAdmin.getInstanceAdminStats paths: /api/admin/instance-admin/statistics: get: operationId: get-instance-admin-stats summary: Instance usage statistics description: >- 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. tags: - - subpackage_instanceAdmin parameters: - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: instanceAdminStatsSchema content: application/json: schema: $ref: '#/components/schemas/instanceAdminStatsSchema' components: schemas: InstanceAdminStatsSchemaPreviousDayMetricsBucketsCount: type: object properties: enabledCount: type: integer description: >- The number of enabled/disabled metrics buckets recorded in the previous day variantCount: type: integer description: The number of variant metrics buckets recorded in the previous day InstanceAdminStatsSchemaActiveUsers: type: object properties: last7: type: integer description: The number of active users in the last 7 days last30: type: integer description: The number of active users in the last 30 days last60: type: integer description: The number of active users in the last 60 days last90: type: integer description: The number of active users in the last 90 days InstanceAdminStatsSchemaProductionChanges: type: object properties: last30: type: integer description: The number of changes in production in the last 30 days last60: type: integer description: The number of changes in production in the last 60 days last90: type: integer description: The number of changes in production in the last 90 days InstanceAdminStatsSchemaClientAppsItemsRange: type: string enum: - value: allTime - value: 30d - value: 7d InstanceAdminStatsSchemaClientAppsItems: type: object properties: range: $ref: '#/components/schemas/InstanceAdminStatsSchemaClientAppsItemsRange' description: A description of a time range count: type: integer description: >- The number of client applications that have been observed in this period InstanceAdminStatsSchemaApiTokens: type: object properties: admin: type: integer description: The number of admin tokens. client: type: integer description: The number of client tokens. frontend: type: integer description: The number of frontend tokens. instanceAdminStatsSchema: type: object properties: instanceId: type: string description: >- A unique identifier for this instance. Generated by the database migration scripts at first run. Typically a UUID. timestamp: type: - string - 'null' format: date-time description: When these statistics were produced versionOSS: type: string description: The version of Unleash OSS that is bundled in this instance versionEnterprise: type: string description: The version of Unleash Enterprise that is bundled in this instance users: type: integer description: The number of users this instance has previousDayMetricsBucketsCount: $ref: >- #/components/schemas/InstanceAdminStatsSchemaPreviousDayMetricsBucketsCount description: >- The number client metrics buckets records recorded in the previous day. # features * # apps * # envs * # hours with metrics activeUsers: $ref: '#/components/schemas/InstanceAdminStatsSchemaActiveUsers' description: The number of active users in the last 7, 30 and 90 days licensedUsers: type: integer description: >- 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: $ref: '#/components/schemas/InstanceAdminStatsSchemaProductionChanges' description: >- The number of changes to the production environment in the last 30, 60 and 90 days featureToggles: type: integer description: The number of feature-toggles this instance has projects: type: integer description: The number of projects defined in this instance. contextFields: type: integer description: The number of context fields defined in this instance. roles: type: integer description: The number of roles defined in this instance groups: type: integer description: The number of groups defined in this instance environments: type: integer description: The number of environments defined in this instance segments: type: integer description: The number of segments defined in this instance strategies: type: integer description: The number of strategies defined in this instance SAMLenabled: type: boolean description: Whether or not SAML authentication is enabled for this instance OIDCenabled: type: boolean description: Whether or not OIDC authentication is enabled for this instance clientApps: type: array items: $ref: '#/components/schemas/InstanceAdminStatsSchemaClientAppsItems' description: >- A count of connected applications in the last week, last month and all time since last restart featureExports: type: integer description: The number of export operations on this instance featureImports: type: integer description: The number of import operations on this instance apiTokens: $ref: '#/components/schemas/InstanceAdminStatsSchemaApiTokens' description: The number of API tokens in Unleash, split by type maxEnvironmentStrategies: type: integer description: >- The highest number of strategies used on a single feature flag in a single environment. maxConstraints: type: integer description: The highest number of constraints used on a single strategy. maxConstraintValues: type: integer description: The highest number of constraint values used on a single constraint. releaseTemplates: type: integer description: The number of release templates in this instance releasePlans: type: integer description: The number of release plans in this instance edgeInstanceUsage: type: object additionalProperties: type: number format: double description: >- The average number of edge instances, per month, in the last 12 months, rounded to 3 decimal places readOnlyUsers: type: integer description: The number of ReadOnly users in this instance sum: type: string description: >- A SHA-256 checksum of the instance statistics to be used to verify that the data in this object has not been tampered with required: - instanceId ``` ## SDK Code Examples ```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() ```