# Get an overview of a project insights. GET https://app.unleash-instance.example.com/api/admin/projects/{projectId}/insights This endpoint returns insights into the specified projects stats, health, lead time for changes, feature types used, members and change requests. Reference: https://docs.getunleash.io/api/get-project-insights ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get an overview of a project insights. version: endpoint_projects.getProjectInsights paths: /api/admin/projects/{projectId}/insights: get: operationId: get-project-insights summary: Get an overview of a project insights. description: >- This endpoint returns insights into the specified projects stats, health, lead time for changes, feature types used, members and change requests. tags: - - subpackage_projects parameters: - name: projectId in: path required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: projectInsightsSchema content: application/json: schema: $ref: '#/components/schemas/projectInsightsSchema' '401': description: >- Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. content: {} '403': description: >- The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation content: {} '404': description: The requested resource was not found. content: {} components: schemas: projectStatsSchema: type: object properties: avgTimeToProdCurrentWindow: 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 createdCurrentWindow: type: number format: double description: The number of feature flags created during the current window createdPastWindow: type: number format: double description: The number of feature flags created during the previous window archivedCurrentWindow: type: number format: double description: >- The number of feature flags that were archived during the current window archivedPastWindow: type: number format: double description: >- The number of feature flags that were archived during the previous window projectActivityCurrentWindow: type: number format: double description: The number of project events that occurred during the current window projectActivityPastWindow: type: number format: double description: >- The number of project events that occurred during the previous window projectMembersAddedCurrentWindow: type: number format: double description: >- The number of members that were added to the project during the current window required: - avgTimeToProdCurrentWindow - createdCurrentWindow - createdPastWindow - archivedCurrentWindow - archivedPastWindow - projectActivityCurrentWindow - projectActivityPastWindow - projectMembersAddedCurrentWindow ProjectInsightsSchemaHealth: type: object properties: rating: type: integer description: >- An indicator of the [project's technical debt](https://docs.getunleash.io/concepts/technical-debt#project-status) on a scale from 0 to 100 activeCount: type: number format: double description: The number of active feature flags. potentiallyStaleCount: type: number format: double description: The number of potentially stale feature flags. staleCount: type: number format: double description: The number of stale feature flags. required: - rating - activeCount - potentiallyStaleCount - staleCount ProjectInsightsSchemaTechnicalDebt: type: object properties: rating: type: integer description: >- An indicator of the [project's technical debt](https://docs.getunleash.io/concepts/technical-debt#project-status) on a scale from 0 to 100 activeCount: type: number format: double description: The number of active feature flags. potentiallyStaleCount: type: number format: double description: The number of potentially stale feature flags. staleCount: type: number format: double description: The number of stale feature flags. required: - rating - activeCount - potentiallyStaleCount - staleCount doraFeaturesSchema: type: object properties: name: type: string description: The name of a feature flag timeToProduction: type: number format: double description: >- The average number of days it takes a feature flag to get into production required: - name - timeToProduction projectDoraMetricsSchema: type: object properties: projectAverage: type: number format: double description: >- The average time it takes a feature flag to be enabled in production. The measurement unit is days. features: type: array items: $ref: '#/components/schemas/doraFeaturesSchema' description: >- An array of objects containing feature flag name and timeToProduction values. The measurement unit of timeToProduction is days. required: - features featureTypeCountSchema: type: object properties: type: type: string description: >- Type of the flag e.g. experiment, kill-switch, release, operational, permission count: type: number format: double description: Number of feature flags of this type required: - type - count ProjectInsightsSchemaMembers: type: object properties: currentMembers: type: number format: double description: The number of total project members change: type: number format: double description: >- The change in the number of project members compared to the previous month required: - currentMembers - change projectInsightsSchema: type: object properties: stats: $ref: '#/components/schemas/projectStatsSchema' description: Project statistics health: $ref: '#/components/schemas/ProjectInsightsSchemaHealth' description: Use `technicalDebt` instead. Summary of the project health technicalDebt: $ref: '#/components/schemas/ProjectInsightsSchemaTechnicalDebt' description: Summary of the projects technical debt leadTime: $ref: '#/components/schemas/projectDoraMetricsSchema' description: Lead time (DORA) metrics featureTypeCounts: type: array items: $ref: '#/components/schemas/featureTypeCountSchema' description: The number of features of each type members: $ref: '#/components/schemas/ProjectInsightsSchemaMembers' description: Active/inactive users summary required: - stats - health - technicalDebt - leadTime - featureTypeCounts - members ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/projects/projectId/insights" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/projects/projectId/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/projects/projectId/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/projects/projectId/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/projects/projectId/insights") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/projects/projectId/insights', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/projects/projectId/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/projects/projectId/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() ```