> 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-insights/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getunleash.io/_mcp/server. # Get instance information GET https://app.unleash-instance.example.com/api/admin/insights **Enterprise feature** Gets high level information about the usage of this Unleash instance, including user, project, and flag information. Reference: https://docs.getunleash.io/api/get-instance-insights ## 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 ## Request ### Query parameters - `from` (string, optional) — The beginning of the date range in yyyy-MM-dd format - `to` (string, optional) — The end of the date range in yyyy-MM-dd format ## Response ### 200 instanceInsightsSchema - `userTrends` (list of InstanceInsightsSchemaUserTrendsItems, required) — How number of users changed over time - `flagTrends` (list of InstanceInsightsSchemaFlagTrendsItems, required) — How number of flags changed over time - `projectFlagTrends` (list of InstanceInsightsSchemaProjectFlagTrendsItems, required) — How number of flags per project changed over time - `metricsSummaryTrends` (list of InstanceInsightsSchemaMetricsSummaryTrendsItems, required) — How metrics data per project changed over time - `environmentTypeTrends` (list of InstanceInsightsSchemaEnvironmentTypeTrendsItems, required) — How updates per environment type changed over time - `lifecycleTrends` (list of InstanceInsightsSchemaLifecycleTrendsItems, required) — Weekly count of new flags entering production - `creationArchiveTrends` (list of InstanceInsightsSchemaCreationArchiveTrendsItems, required) — Weekly count of created vs archived flags by project and flag type ## Types ### InstanceInsightsSchemaUserTrendsItems - `date` (string, required) — A UTC date when the stats were captured. Time is the very end of a given day. - `total` (double, required) — The number of actual Unleash users on a particular day - `active` (double, required) — The number of active Unleash users on a particular day - `inactive` (double, required) — The number of inactive Unleash users on a particular day ### InstanceInsightsSchemaFlagTrendsItems - `date` (string, required) — A UTC date when the stats were captured. Time is the very end of a given day. - `total` (double, required) — The number of all flags on a particular day - `active` (double, required) — The number of active flags on a particular day - `stale` (double, required) — The number of user marked stale flags on a particular day - `potentiallyStale` (double, required) — The number of time calculated potentially stale flags on a particular day ### InstanceInsightsSchemaProjectFlagTrendsItems - `week` (string, required) — Year and week in a given year for which the stats were calculated - `project` (string, required) — Project id of the project the flag trends belong to - `date` (string, required) — A UTC date when the stats were captured. Time is the very end of a given day. - `total` (double, required) — The number of all flags on a particular day - `active` (double, required) — The number of active flags on a particular day - `stale` (double, required) — The number of user marked stale flags on a particular day - `potentiallyStale` (double, required) — The number of time calculated potentially stale flags on a particular day - `health` (double, required, deprecated) — Use `technicalDebt` instead. - `technicalDebt` (double, optional) — An indicator of the [project's technical debt](https://docs.getunleash.io/concepts/technical-debt) on a scale from 0 to 100 - `timeToProduction` (double, optional) — The average time from when a feature was created to when it was enabled in the "production" environment during the current window - `users` (double, optional) — The number of users who have access to the project ### InstanceInsightsSchemaMetricsSummaryTrendsItems - `week` (string, required) — Year and week in a given year for which the metrics summary was calculated - `date` (string, required) — A UTC date when metrics summary was captured. Time is the very end of a given day. - `project` (string, required) — Project id of the project the impressions summary belong to - `totalRequests` (double, required) — Total number of times all project flags were requested - `totalYes` (double, required) — Total number of times all project flags were exposed across all environments - `totalNo` (double, required) — Total number of times all project flags were not exposed across all environments - `totalApps` (double, required) — Total number of applications the impression data belong to - `totalFlags` (double, required) — Total number of flags the impression data belong to - `totalEnvironments` (double, required) — Total number of environments the impression data belong to ### InstanceInsightsSchemaEnvironmentTypeTrendsItems - `date` (string, required) — A UTC date when the stats were captured. Time is the very end of a given day. - `week` (string, required) — Year and week in a given year for which the stats were calculated - `environmentType` (string, required) — Environment type the data belongs too - `totalUpdates` (double, required) — Total number of times configuration has been updated in the environment type ### InstanceInsightsSchemaLifecycleTrendsItems - `week` (string, required) — Year and week in a given year for which the stats were calculated - `date` (string, required) — A UTC date when the stats were captured. Time is the very end of a given week. - `newProductionFlags` (double, required) — Number of flags that entered production during this week - `project` (string, required) — Project id that the flags belong to ### InstanceInsightsSchemaCreationArchiveTrendsItems - `week` (string, required) — Year and week in a given year for which the stats were calculated - `date` (string, required) — A UTC date when the stats were captured. Time is the very end of a given week. - `project` (string, required) — Project id that the flags belong to - `createdFlags` (map from string to double, required) — Count of newly created flags by flag type - `archivedFlags` (double, required) — Total count of archived flags during this week ## Examples **Response** ```json { "userTrends": [ { "date": "2024-01-12T23:59:59.999Z", "total": 100, "active": 98, "inactive": 2 } ], "flagTrends": [ { "date": "2024-01-12T23:59:59.999Z", "total": 100, "active": 98, "stale": 0, "potentiallyStale": 2 } ], "projectFlagTrends": [ { "week": "2024-40", "project": "default", "date": "2024-01-12T23:59:59.999Z", "total": 100, "active": 98, "stale": 0, "potentiallyStale": 2, "health": 50, "technicalDebt": 20, "timeToProduction": 10, "users": 30 } ], "metricsSummaryTrends": [ { "week": "2024-01", "date": "2024-01-12T23:59:59.999Z", "project": "default", "totalRequests": 50, "totalYes": 50, "totalNo": 50, "totalApps": 50, "totalFlags": 50, "totalEnvironments": 50 } ], "environmentTypeTrends": [ { "date": "2024-01-12T23:59:59.999Z", "week": "2024-01", "environmentType": "production", "totalUpdates": 50 } ], "lifecycleTrends": [ { "week": "2024-15", "date": "2024-04-12T23:59:59.999Z", "newProductionFlags": 5, "project": "default" } ], "creationArchiveTrends": [ { "week": "2024-15", "date": "2024-04-12T23:59:59.999Z", "project": "default", "createdFlags": { "experiment": 5, "operational": 1, "release": 2 }, "archivedFlags": 3 } ] } ``` **SDK Code** ```python import requests url = "https://app.unleash-instance.example.com/api/admin/insights" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/insights'; 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/insights" 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/insights") 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/insights") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/insights', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/insights"); 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/insights")! 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() ```