# 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 ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get instance information version: endpoint_unstable.getInstanceInsights paths: /api/admin/insights: get: operationId: get-instance-insights summary: Get instance information description: >- **Enterprise feature** Gets high level information about the usage of this Unleash instance, including user, project, and flag information. tags: - - subpackage_unstable parameters: - name: from in: query description: The beginning of the date range in yyyy-MM-dd format required: false schema: type: string - name: to in: query description: The end of the date range in yyyy-MM-dd format required: false schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: instanceInsightsSchema content: application/json: schema: $ref: '#/components/schemas/instanceInsightsSchema' components: schemas: InstanceInsightsSchemaUserTrendsItems: type: object properties: date: type: string format: date-time description: >- A UTC date when the stats were captured. Time is the very end of a given day. total: type: number format: double description: The number of actual Unleash users on a particular day active: type: number format: double description: The number of active Unleash users on a particular day inactive: type: number format: double description: The number of inactive Unleash users on a particular day required: - date - total - active - inactive InstanceInsightsSchemaFlagTrendsItems: type: object properties: date: type: string format: date-time description: >- A UTC date when the stats were captured. Time is the very end of a given day. total: type: number format: double description: The number of all flags on a particular day active: type: number format: double description: The number of active flags on a particular day stale: type: number format: double description: The number of user marked stale flags on a particular day potentiallyStale: type: number format: double description: >- The number of time calculated potentially stale flags on a particular day required: - date - total - active - stale - potentiallyStale InstanceInsightsSchemaProjectFlagTrendsItems: type: object properties: week: type: string description: Year and week in a given year for which the stats were calculated project: type: string description: Project id of the project the flag trends belong to health: type: number format: double description: Use `technicalDebt` instead. technicalDebt: type: number format: double description: >- An indicator of the [project's technical debt](https://docs.getunleash.io/concepts/technical-debt) on a scale from 0 to 100 timeToProduction: type: number format: double description: >- The average time from when a feature was created to when it was enabled in the "production" environment during the current window date: type: string format: date-time description: >- A UTC date when the stats were captured. Time is the very end of a given day. total: type: number format: double description: The number of all flags on a particular day active: type: number format: double description: The number of active flags on a particular day stale: type: number format: double description: The number of user marked stale flags on a particular day potentiallyStale: type: number format: double description: >- The number of time calculated potentially stale flags on a particular day users: type: number format: double description: The number of users who have access to the project required: - week - project - health - date - total - active - stale - potentiallyStale InstanceInsightsSchemaMetricsSummaryTrendsItems: type: object properties: week: type: string description: >- Year and week in a given year for which the metrics summary was calculated date: type: string format: date-time description: >- A UTC date when metrics summary was captured. Time is the very end of a given day. project: type: string description: Project id of the project the impressions summary belong to totalRequests: type: number format: double description: 'Total number of times all project flags were requested ' totalYes: type: number format: double description: >- Total number of times all project flags were exposed across all environments totalNo: type: number format: double description: >- Total number of times all project flags were not exposed across all environments totalApps: type: number format: double description: Total number of applications the impression data belong to totalFlags: type: number format: double description: Total number of flags the impression data belong to totalEnvironments: type: number format: double description: Total number of environments the impression data belong to required: - week - date - project - totalRequests - totalYes - totalNo - totalApps - totalFlags - totalEnvironments InstanceInsightsSchemaEnvironmentTypeTrendsItems: type: object properties: date: type: string format: date-time description: >- A UTC date when the stats were captured. Time is the very end of a given day. week: type: string description: Year and week in a given year for which the stats were calculated environmentType: type: string description: Environment type the data belongs too totalUpdates: type: number format: double description: >- Total number of times configuration has been updated in the environment type required: - date - week - environmentType - totalUpdates InstanceInsightsSchemaLifecycleTrendsItems: type: object properties: week: type: string description: Year and week in a given year for which the stats were calculated date: type: string format: date-time description: >- A UTC date when the stats were captured. Time is the very end of a given week. newProductionFlags: type: number format: double description: Number of flags that entered production during this week project: type: string description: Project id that the flags belong to required: - week - date - newProductionFlags - project InstanceInsightsSchemaCreationArchiveTrendsItems: type: object properties: week: type: string description: Year and week in a given year for which the stats were calculated date: type: string format: date-time description: >- A UTC date when the stats were captured. Time is the very end of a given week. project: type: string description: Project id that the flags belong to createdFlags: type: object additionalProperties: type: number format: double description: Count of newly created flags by flag type archivedFlags: type: number format: double description: Total count of archived flags during this week required: - week - date - project - createdFlags - archivedFlags instanceInsightsSchema: type: object properties: userTrends: type: array items: $ref: '#/components/schemas/InstanceInsightsSchemaUserTrendsItems' description: How number of users changed over time flagTrends: type: array items: $ref: '#/components/schemas/InstanceInsightsSchemaFlagTrendsItems' description: How number of flags changed over time projectFlagTrends: type: array items: $ref: '#/components/schemas/InstanceInsightsSchemaProjectFlagTrendsItems' description: How number of flags per project changed over time metricsSummaryTrends: type: array items: $ref: >- #/components/schemas/InstanceInsightsSchemaMetricsSummaryTrendsItems description: How metrics data per project changed over time environmentTypeTrends: type: array items: $ref: >- #/components/schemas/InstanceInsightsSchemaEnvironmentTypeTrendsItems description: How updates per environment type changed over time lifecycleTrends: type: array items: $ref: '#/components/schemas/InstanceInsightsSchemaLifecycleTrendsItems' description: Weekly count of new flags entering production creationArchiveTrends: type: array items: $ref: >- #/components/schemas/InstanceInsightsSchemaCreationArchiveTrendsItems description: Weekly count of created vs archived flags by project and flag type required: - userTrends - flagTrends - projectFlagTrends - metricsSummaryTrends - environmentTypeTrends - lifecycleTrends - creationArchiveTrends ``` ## SDK Code Examples ```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() ```